今天刚更新了Android Studio 2.2,重新编译项目时就出现了以下问题:
Error:A problem was found with the configuration of task ':app:packageDebug'.
> File xxx specified for property 'resourceFile' does not exist.
- 1
- 2
- 1
- 2
在Stack Overflow查了下,有人说是开启了Instant Run,关闭即可;又有人说是设置了shrinkResources,只需将其设为false。试了下,只需要将shrinkResources改为false即可,开启Instant Run也不会报错,但依旧第一次运行时白屏…(TㅅT)
buildTypes {
debug {
//Zipalign优化
zipAlignEnabled true
// 移除无用的resource文件
shrinkResources false
//混淆
minifyEnabled false
//加载默认混淆配置文件
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
//Zipalign优化
zipAlignEnabled true
// 移除无用的resource文件
shrinkResources true
//混淆
minifyEnabled true
//加载默认混淆配置文件
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22