AS Error:File xxx specified for property 'resourceFile' does not exist

升级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.

解决方法:将shrinkResource设置为false

buildTypes {
        release {
            // 不显示Log
            buildConfigField "boolean", "LOG_DEBUG", "false"
            //混淆
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            //Zip代码压缩优化
            zipAlignEnabled true
            //移除无用资源
            shrinkResources false
            signingConfig signingConfigs.release
        }
        debug {
            //Zip代码压缩优化
            zipAlignEnabled true
            //移除无用资源
            shrinkResources false
            signingConfig signingConfigs.release
            minifyEnabled false
        }
    }

你可能感兴趣的:(AS)