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 true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

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

如下所示:

 buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

第二步:重新编译即可。

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)

 buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

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

转载请保留原文地址:http://blog.csdn.net/ouyang_peng

我的Android进阶之旅------>解决:debug-stripped.ap_' specified for property 'resourceFile' does not exist.的更多相关文章

  1. 解决:debug-stripped.ap_' specified for property 'resourceFile' does not exist.

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

  2. 解决 release-stripped.ap_' specified for property 'resourceFile' does not exist.

    设置buildTypes里的release的shrinkResources为false即可,如果是 release-stripped.ap_' specified for property 'reso ...

  3. 我的Android进阶之旅------>解决Jackson等第三方转换Json的开发包在开启混淆后转换的实体类数据都是null的bug

    1.错误描述 今天测试人员提了一个bug,说使用我们的app出现了闪退的bug,后来通过debug断点调试,发现我们的app转换服务器发送过来的json数据后,都是为null.而之前已经提测快一个月的 ...

  4. 我的Android进阶之旅------>解决Error: specified for property 'mergedManifest' does not exist.

    错误描述 刚运行从Github上面下载而来的代码时,爆了如下所示的bug,错误描述如下所示: Error:A problem was found with the configuration of t ...

  5. 我的Android进阶之旅------>解决Your project contains error(s),please fix them

    在使用eclipse写好Android的代码,代码没有报错.然后想在AVD中运行测试时,弹出错误框,提示信息为:  "Your project contains error(s),pleas ...

  6. 我的Android进阶之旅------>解决:Failed to create 'build\outputs\apk\watch-debug-unaligned.apks': 拒绝访问。

    1. 错误描述 今天用Android Studio进行项目编译的时候,报错如下所示: FAILURE: Build failed with an exception. * What went wron ...

  7. 我的Android进阶之旅------>解决DownloadManager报错java.lang.SecurityException: Invalid value for visibility: 2

    1.问题描述 今天使用Android系统的DownloadManager进行下载操作时,爆了如下所示的错误: java.lang.RuntimeException: Unable to start s ...

  8. 我的Android进阶之旅------>解决Error:Unable to find method 'org.gradle.api.internal.project.ProjectInternal.g

    错误描述 今天在Github上面下载了一份代码,然后导入到Android Studio中直接报了如下图所示的错误: 错误描述如下: Error: Unable to find method 'org. ...

  9. 我的Android进阶之旅------>解决Error:Could not find property 'compile' on org.gradle.api.internal.artifacts.

    1错误描述 解决方法 1错误原因 2解决方法 1.错误描述 刚刚,Android Studio突然编译不了了,报了如下错误: Error:Could not find property 'compil ...

随机推荐

  1. redis 服务相关

    一 什么是redis Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API.从2010年3月15日起,Redis的开 ...

  2. 跟着百度学PHP[14]-PDO-优化驱动

    使用方法设置预定义变量 PDO的方法/属性 PDO::beginTransaction — Initiates a transaction PDO::commit — Commits a transa ...

  3. root-me web server 10-20 writeup

    File upload - double extensions文件上传--双扩展 Gallery v0.02 介绍 Your goal is to hack this photo galery by ...

  4. Link-based Classification相关数据集

    Link-based Classification相关数据集 Datasets Document Classification Datasets: CiteSeer: The CiteSeer dat ...

  5. Python_uuid 学习总结

    1. 背景知识: UUID: 通用唯一标识符 ( Universally Unique Identifier ), 对于所有的UUID它可以保证在空间和时间上的唯一性. 它是通过MAC地址, 时间戳, ...

  6. tplink 703刷固件

    1.软件下载: ImageBuilder链接 如果是全新刷机的话,使用:http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/open ...

  7. Python捕获异常

    一.常见异常 1.语法错误:SyntaxError:invalid syntax (1)案例: (1)解决方法: ①查看代码有没有红色波浪线 ②熟悉python基本语法 2.变量名不存在:NameEr ...

  8. [Linux 学习] Centos 使用yum出现Loaded plugins: refresh-packagekit, security

    sudo vim  /etc/yum/pluginconf.d/fastestmirror.conf enabled=0  //把1改为0 verbose=0 socket_timeout=3 hos ...

  9. Oracle之完全卸载

    1. 开始->设置->控制面板->管理工具->服务 停止所有Oracle服务. 2. 开始->程序->Oracle - OraHome81->Oracle I ...

  10. 主干(trunk)、分支(branch )、标记(tag) 用法示例 + 图解

    以svn为例,git的master相当于trunk,dev分支相当于branches --------------------------------------------------------- ...