700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 我的Android进阶之旅------解决:debug-stripped.ap_' specified for property 'resourceFile' does not exist....

我的Android进阶之旅------解决:debug-stripped.ap_' specified for property 'resourceFile' does not exist....

时间:2021-03-11 00:45:48

相关推荐

我的Android进阶之旅------解决:debug-stripped.ap_' specified for property   'resourceFile' does not exist....

1.错误描述

更新Android Studio到2.0版本后,出现了编译失败的问题,我clean project然后重新编译还是出现抑郁的问题,问题具体描述如下所示:

Error:A problem was found with the configuration of task ':watch:packageOfficialDebug'.> File 'D:\Code\XTC_VersionCompatible\watch\build\intermediates\res\resources-official-debug-stripped.ap_' specified for property 'resourceFile' does not exist.

如下图所示:

2. 解决方法

解决方法一

第一步:File—>Settings,打开Settings界面,搜索到Instant Run,如下图所示

第二步:去掉第一项的勾选,即去掉“Enable Instant Run to hot swap code/resources on deploy (default enabled)”,如下图所示:

第三步:再重新编译,即可成功。

解决方法二

关闭Debug模式下的混淆开关和移除无用资源开关,如下所示:

我本地的大致如下,开启了混淆

buildTypes {release {minifyEnabled trueshrinkResources trueproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}debug {minifyEnabled trueshrinkResources trueproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}

第一步:关闭debug模式下的混淆开关和移除无用资源开关,即将minifyEnabled true改为minifyEnabled false,shrinkResources true改为shrinkResources false

如下所示:

buildTypes {release {minifyEnabled trueshrinkResources trueproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}debug {minifyEnabled falseshrinkResources falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}

第二步:重新编译即可。

3、参考

上述解决方法参考于:/questions/36540676/build-intermediates-res-resources-anzhi-debug-stripped-ap-specified-for-prope

Instant Run feature not compatible with proguard on debug mod.

/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 candisable Instant Runordisable proguard on debug mod.

(Disabling ProGuard on debug.gradle)

buildTypes {release {minifyEnabled trueshrinkResources trueproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}debug {minifyEnabled falseshrinkResources falseproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}

作者:欧阳鹏 欢迎转载,与人分享是进步的源泉!

转载请保留原文地址:/ouyang_peng

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。