完整error log:
Error:A problem was found with the configuration of task ':app:packageDebug'.
> File 'D:\Android\MySpace\CommonFrame\app\build\intermediates\res\resources-debug-stripped.ap_' specified for property 'resourceFile' does not exist.
1、如果是Android Studio 2.2版本
在App的build.gradle中必须设置:shrinkResources false。
代码如下:
buildTypes {
release {
minifyEnabled true //混淆打包
zipAlignEnabled true //Zipalign优化
shrinkResources true // 是否去除无效的资源文件
signingConfig signingConfigs.release //签名
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
versionNameSuffix "-debug" //版本号加上debug
minifyEnabled false
zipAlignEnabled true //Zipalign优化
shrinkResources false //去除无用资源resource文件
signingConfig signingConfigs.debug //签名
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
2、如果是Android Studio 2.0版本
需要在设置中关闭Instant Run。
以上记录。
2017.02.17