今天刚更新了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.
在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'}}