...\build\intermediates\res\resources-official-release-stripped.ap_' specified for property 'resourc
编译apk的时候遇到下面的问题:
Error:A problem was found with the configuration of task’:uhome_app:packageOfficialRelease’.
File ‘D:\segi_workspace\branches\uhome\uhome_huarun\joylife_v1.2.0\uhome_app\build\intermediates\res\resources-official-release-stripped.ap_’specified for property ‘resourceFile’ does not exist.
提示中的’resourceFile’ does not exist. 是重点。表示resourceFile不存在。
经过网上找资料发现问题 在 下图中红色框中的两个配置:
//是否进行代码压缩 minifyEnabled false// 移除无用的resource文件shrinkResources true
如上设置 minifyEnabled 为 false , shrinkResources 为 true 的时候会出现上面 ‘resourceFile’ does not exist.的错误。官方的文档给出了解释 :https://developer.android.com/studio/build/shrink-code?hl=zh-cn
解决的办法就是同时设为true
压缩资源
资源压缩只与代码压缩协同工作。代码压缩器移除所有未使用的代码后,资源压缩器便可确定应用仍然使用的资源。这在您添加包含资源的代码库时体现得尤为明显 - 您必须移除未使用的库代码,使库资源变为未引用资源,才能通过资源压缩器将它们移除。
要启用资源压缩,请在 build.gradle 文件中将 shrinkResources 属性设置为 true(在用于代码压缩的 minifyEnabled 旁边)。例如:
android {...buildTypes {release {shrinkResources trueminifyEnabled trueproguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'}}
}
如果您尚未使用代码压缩用途的 minifyEnabled 构建应用,请先尝试使用它,然后再启用 shrinkResources,因为您可能需要编辑 proguard-rules.pro 文件以保留动态创建或调用的类或方法,然后再开始移除资源。
注:资源压缩器目前不会移除 values/ 文件夹中定义的资源(例如字符串、尺寸、样式和颜色)。这是因为 Android 资源打包工具
(AAPT) 不允许 Gradle 插件为资源指定预定义版本。
...\build\intermediates\res\resources-official-release-stripped.ap_' specified for property 'resourc相关推荐
- app\build\intermediates\res\merged\debug\values-v23\values-v23.xml 编译出错的问题
解决问题的关键在于版本匹配, compileSdkVersion compileSdkVersion targetSdkVersion 这三个参数的整数值都应该是一样的,这里我全部设置成23, 在这之 ...
- 我的Android进阶之旅------解决:debug-stripped.ap_' specified for property 'resourceFile' does not exist....
1.错误描述 更新Android Studio到2.0版本后,出现了编译失败的问题,我clean project然后重新编译还是出现抑郁的问题,问题具体描述如下所示: Error:A problem ...
- android.content.res.Resources$NotFoundException: Resource ID #0xff3f92d5
今天遇到一个问题,在小米.华为手机上没有报错,在oppo 5.1版本报android.content.res.Resources$NotFoundException: Resource ID #0xf ...
- AndroidStudio中提示:android.content.res.Resources NotFoundException: String resource ID 0x
场景 在Android Studio中对TextView调用setText时传入的是Int类型的值,就会提示: android.content.res.Resources NotFoundExcept ...
- Android之提示android.content.res.Resources$NotFoundException: Resource ID #0x7f08010a
1 问题 在我的oppo机器上面运行一个页面没有奔溃,但是在红米安卓5.1版本运行页面奔溃,奔溃信息如下 /Timeline(11600): Timeline: Activity_launch_req ...
- 【模板】在build中配置resources来防止我们资源导出失败的问题
在build中配置resources,来防止我们资源导出失败的问题 <!--在build中配置resources,来防止我们资源导出失败的问题--><build><res ...
- Android报“android.content.res.Resources$NotFoundException: String resource ID #0x2”错误
Android报"android.content.res.Resources$NotFoundException: String resource ID #0x2"错误 当调用se ...
- android.content.res.Resources$NotFoundException: String resource ID XXXX
错误:android.content.res.Resources$NotFoundException: String resource ID XXXX 原因:一般发生在参数 int resId 错误, ...
- Android Problem- android.content.res.Resources$NotFoundException: String resource ID #0xa
在使用listview时出现错误android.content.res.Resources$NotFoundException: String resource ID #0xa 经查证是在调用Text ...
最新文章
- 用 TensorFlow 目标检测 API 发现皮卡丘!
- asp php时间格式,ASP_asp格式化日期时间格式的代码,' ====================================== - phpStudy...
- Codeforces Round #320 (Div. 1) [Bayan Thanks-Round] A A Problem about Polyline(数学)
- 如何在类的外部修改类中的私有数据成员
- Python中文乱码
- k8s架构以及相关概念普及
- Atitit.软件开发提升稳定性总结
- mysql5.7越用c盘越小_Windows7的C盘可用空间为什么越用越小呢?
- 关于开机USB电涌15秒关机的另类解决方法
- Python-python程序打包为独立的EXE文件,并配上自定义的图标
- hMailServer设置
- 微软疑淡化邮件服务被黑事件;DOTA2 AI 2:0 完胜世界冠军
- 微信公众号订阅号申请注册教程
- wifi网速慢的六个因素
- 企业级虚拟化实战之KVM——从KVM到云计算OpenStack
- 虎扑体育客户端zen源码学习笔记
- Flink中Window详解之Window的聚合函数AggregateFunction
- 区块链需要学习哪些东西_2020年学区块链需要什么基础?(非常详细)
- 网优谷Java技术分享交流
- vue 实现手写电子签名/生成图片