解决:debug-stripped.ap_' specified for property 'resourceFile' does not exist.
2016-10-12 14:01
411 查看
1.错误描述
更新Android Studio到2.0版本后,出现了编译失败的问题,我clean project然后重新编译还是出现抑郁的问题,问题具体描述如下所示:<code class="hljs vhdl has-numbering"> Error:A problem was found <span class="hljs-keyword">with</span> the <span class="hljs-keyword">configuration</span> <span class="hljs-keyword">of</span> task ':watch:packageOfficialDebug'. > <span class="hljs-keyword">File</span> <span class="hljs-attribute">'D</span>:\Code\XTC_VersionCompatible\watch\build\intermediates\res\resources-official-debug-stripped.ap_' specified <span class="hljs-keyword">for</span> <span class="hljs-keyword">property</span> <span class="hljs-attribute">'resourceFile</span>' does <span class="hljs-keyword">not</span> exist.</code><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul><div class="save_code tracking-ad" style="display: none;" data-mod="popu_249"><a target=_blank target="_blank"><img src="http://static.blog.csdn.net/images/save_snippets.png" alt="" /></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul>
如下图所示:
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">true</span> shrinkResources <span class="hljs-keyword">true</span> proguardFiles getDefaultProguardFile(<span class="hljs-string">'proguard-android.txt'</span>), <span class="hljs-string">'proguard-rules.pro'</span> } <span class="hljs-built_in">debug</span> { minifyEnabled <span class="hljs-keyword">true</span> shrinkResources <span class="hljs-keyword">true</span> proguardFiles getDefaultProguardFile(<span class="hljs-string">'proguard-android.txt'</span>), <span class="hljs-string">'proguard-rules.pro'</span> } }</code><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li></ul><div class="save_code tracking-ad" style="display: none;" data-mod="popu_249"><a target=_blank target="_blank"><img src="http://static.blog.csdn.net/images/save_snippets.png" alt="" /></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li></ul>
第一步:关闭debug模式下的混淆开关和移除无用资源开关,即将minifyEnabled true改为minifyEnabled false,shrinkResources true改为shrinkResources false
如下所示:
<code class="hljs lua has-numbering"> buildTypes { release { minifyEnabled <span class="hljs-keyword">true</span> shrinkResources <span class="hljs-keyword">true</span> proguardFiles getDefaultProguardFile(<span class="hljs-string">'proguard-android.txt'</span>), <span class="hljs-string">'proguard-rules.pro'</span> } <span class="hljs-built_in">debug</span> { minifyEnabled <span class="hljs-keyword">false</span> shrinkResources <span class="hljs-keyword">false</span> proguardFiles getDefaultProguardFile(<span class="hljs-string">'proguard-android.txt'</span>), <span class="hljs-string">'proguard-rules.pro'</span> } }</code><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li></ul><div class="save_code tracking-ad" style="display: none;" data-mod="popu_249"><a target=_blank target="_blank"><img src="http://static.blog.csdn.net/images/save_snippets.png" alt="" /></a></div><ul class="pre-numbering"><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li><li>10</li><li>11</li><li>12</li></ul>
第二步:重新编译即可。
3、参考
上述解决方法参考于:http://stackoverflow.com/questions/36540676/build-intermediates-res-resources-anzhi-debug-stripped-ap-specified-for-propeInstant 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">true</span> shrinkResources <span class="hljs-keyword">true</span> proguardFiles getDefaultProguardFile(<span class="hljs-string">'proguard-android.txt'</span>), <span class="hljs-string">'proguard-rules.pro'</span> } <span class="hljs-built_in">debug</span> { minifyEnabled <span class="hljs-keyword">false</span> shrinkResources <span class="hljs-keyword">false</span> proguardFiles getDefaultProguardFile(<span class="hljs-string">'proguard-android.txt'</span>), <span class="hljs-string">'proguard-rules.pro'</span> } }</code>
相关文章推荐
- 我的Android进阶之旅------>解决:debug-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.
- 解决 AS2.2正式版 release-stripped.ap_' specified for property 'resourceFile' does not exist.
- 解决 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.
- resources-release-stripped.ap_' specified for property 'resourceFile' does not exist
- \build\intermediates\res\xxx-stripped.ap_' 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.解决方法
- specified for property 'resourceFile' does not exist
- AS Error:File xxx specified for property 'resourceFile' does not exist
- 关于productFlavors使用和specified for property 'resourceFile' does not exist.问题
- File xxx specified for property 'resourceFile' does not exist.
- Error:A problem ... resources-release-stripped.ap_' specified for property 'resourceFile' does not
- 我的Android进阶之旅------>解决Error: specified for property 'mergedManifest' does not exist.