debug-stripped.ap_' specified for property 'resourceFile' does not exist.处理办法
来源:互联网 发布:sql语句查询字段长度 编辑:程序博客网 时间:2024/06/05 10:05
解决:debug-stripped.ap_' specified for property 'resourceFile' does not exist.
1.错误描述
更新Android Studio到2.0版本后,出现了编译失败的问题,我clean project然后重新编译还是出现抑郁的问题,问题具体描述如下所示:
<code class="hljs vhdl has-numbering">Error:A problem was found <span class="hljs-keyword" style="line-height: 1.5; color: rgb(0, 0, 255);">with the <span class="hljs-keyword" style="line-height: 1.5;">configuration <span class="hljs-keyword" style="line-height: 1.5;">of task ':watch:packageOfficialDebug'.> <span class="hljs-keyword" style="line-height: 1.5;">File <span class="hljs-attribute" style="line-height: 1.5; color: rgb(163, 21, 21);">'D:\Code\XTC_VersionCompatible\watch\build\intermediates\res\resources-official-debug-stripped.ap_' specified <span class="hljs-keyword" style="line-height: 1.5; color: rgb(0, 0, 255);">for <span class="hljs-keyword" style="line-height: 1.5;">property <span class="hljs-attribute" style="line-height: 1.5; color: rgb(163, 21, 21);">'resourceFile' does <span class="hljs-keyword" style="line-height: 1.5; color: rgb(0, 0, 255);">not exist.</span></span></span></span></span></span></span></span></span></code>
如下图所示:
2. 解决方法
解决方法一
第一步:File—>Settings,打开Settings界面,搜索到Instant Run,如下图所示
第二步:去掉第一项的勾选,即去掉“Enable Instant Run to hot swap code/resources on deploy (default enabled)”,如下图所示:
第三步:再重新编译,即可成功。
解决方法二
关闭Debug模式下的混淆开关,如下所示:
我本地的大致如下,开启了混淆
<code class="hljs lua has-numbering"> buildTypes { release { minifyEnabled <span class="hljs-keyword" style="line-height: 1.5; color: rgb(0, 0, 255);">true shrinkResources <span class="hljs-keyword" style="line-height: 1.5;">true proguardFiles getDefaultProguardFile(<span class="hljs-string" style="line-height: 1.5; color: rgb(163, 21, 21);">'proguard-android.txt'), <span class="hljs-string" style="line-height: 1.5;">'proguard-rules.pro' } <span class="hljs-built_in" style="line-height: 1.5; color: rgb(0, 0, 255);">debug { minifyEnabled <span class="hljs-keyword" style="line-height: 1.5;">true shrinkResources <span class="hljs-keyword" style="line-height: 1.5;">true proguardFiles getDefaultProguardFile(<span class="hljs-string" style="line-height: 1.5; color: rgb(163, 21, 21);">'proguard-android.txt'), <span class="hljs-string" style="line-height: 1.5;">'proguard-rules.pro' }}</span></span></span></span></span></span></span></span></span></code>
第一步:关闭debug模式下的混淆开关,即将minifyEnabled true改为minifyEnabled false,如下所示:
<code class="hljs lua has-numbering"> buildTypes { release { minifyEnabled <span class="hljs-keyword" style="line-height: 1.5; color: rgb(0, 0, 255);">true shrinkResources <span class="hljs-keyword" style="line-height: 1.5;">true proguardFiles getDefaultProguardFile(<span class="hljs-string" style="line-height: 1.5; color: rgb(163, 21, 21);">'proguard-android.txt'), <span class="hljs-string" style="line-height: 1.5;">'proguard-rules.pro' } <span class="hljs-built_in" style="line-height: 1.5; color: rgb(0, 0, 255);">debug { minifyEnabled <span class="hljs-keyword" style="line-height: 1.5;">false shrinkResources <span class="hljs-keyword" style="line-height: 1.5;">false proguardFiles getDefaultProguardFile(<span class="hljs-string" style="line-height: 1.5; color: rgb(163, 21, 21);">'proguard-android.txt'), <span class="hljs-string" style="line-height: 1.5;">'proguard-rules.pro' }}</span></span></span></span></span></span></span></span></span></code>
第二步:重新编译即可。
3、参考
上述解决方法参考于:http://stackoverflow.com/questions/36540676/build-intermediates-res-resources-anzhi-debug-stripped-ap-specified-for-prope
Instant Run feature not compatible with proguard on debug mod.
http://tools.android.com/tech-docs/instant-run
Note: Instant Run temporarily disables the Java Code Coverage Library (JaCoCo) and ProGuard. Because Instant Run only works with debug builds, this should not affect your release build.
You can disable Instant Run or disable proguard on debug mod.
(Disabling ProGuard on debug.gradle)
<code class="hljs lua has-numbering"> buildTypes { release { minifyEnabled <span class="hljs-keyword" style="line-height: 1.5; color: rgb(0, 0, 255);">true shrinkResources <span class="hljs-keyword" style="line-height: 1.5;">true proguardFiles getDefaultProguardFile(<span class="hljs-string" style="line-height: 1.5; color: rgb(163, 21, 21);">'proguard-android.txt'), <span class="hljs-string" style="line-height: 1.5;">'proguard-rules.pro' } <span class="hljs-built_in" style="line-height: 1.5; color: rgb(0, 0, 255);">debug { minifyEnabled <span class="hljs-keyword" style="line-height: 1.5;">false shrinkResources <span class="hljs-keyword" style="line-height: 1.5;">false proguardFiles getDefaultProguardFile(<span class="hljs-string" style="line-height: 1.5; color: rgb(163, 21, 21);">'proguard-android.txt'), <span class="hljs-string" style="line-height: 1.5;">'proguard-rules.pro' }}</span></span></span></span></span></span></span></span></span></code>
- debug-stripped.ap_' specified for property 'resourceFile' does not exist.处理办法
- release-stripped.ap_' specified for property 'resourceFile' does not exist.
- 解决:debug-stripped.ap_' specified for property 'resourceFile' does not exist.
- 错误:resources-debug-stripped.ap_' specified for property 'resourceFile' does not exist.
- resources-debug-stripped.ap_' specified for property 'resourceFile' does not exist.
- android studio 报错resources-debug-stripped.ap_' specified for property 'resourceFile' does not exist.
- 我的Android进阶之旅------>解决:debug-stripped.ap_' specified for property 'resourceFile' does not exist.
- 我的Android进阶之旅------>解决:debug-stripped.ap_' specified for property 'resourceFile' does not exist.
- \build\intermediates\res\xxx-stripped.ap_' specified for property 'resourceFile' does not exist
- AS2.2打包:release-stripped.ap_' specified for property 'resourceFile' does not exist
- 解决 AS2.2正式版 release-stripped.ap_' specified for property 'resourceFile' does not exist.
- 解决 release-stripped.ap_' specified for property 'resourceFile' does not exist.
- Android studio打包时的问题xxxxrelease-stripped.ap_' specified for property 'resourceFile' does not exist.
- android studio 打包resources-release-stripped.ap_' specified for property 'resourceFile' does not exis
- specified for property 'resourceFile' does not exist
- File xxx specified for property 'resourceFile' does not exist.解决方法
- File xxx specified for property 'resourceFile' does not exist.解决方法
- File xxx specified for property 'resourceFile' does not exist.解决方法
- Docke 1.12 基础篇:48条命令(2)
- Kafka源码深度解析-序列2 -Producer -Metadata的数据结构与读取、更新策略
- Storm 集群配置(二)
- Android主题和样式之系统篇(下级)
- RestHttp
- debug-stripped.ap_' specified for property 'resourceFile' does not exist.处理办法
- java中HashMap,LinkedHashMap,TreeMap,HashTable的区别
- Swift - 文本框textView图文混排的实现(附样例)
- 《程序员的思维修炼》读书笔记以及感悟
- javascript DOM操作
- git 命令
- 你真的理解android事件分发机制了吗
- 使用ionic开发移动app的过程中经验总结
- Phoenix默认jvm配置