Android 报错 :Removing unused resources requires unused code shrinking to be turned on.

  • 当Gradle 配置为如下的时候
 buildTypes {
        release {
            //清理无用资源
            shrinkResources false
            //是否开启zipAlign压缩
            zipAlignEnabled true
            //是否混淆
            minifyEnabled false
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
  • 可能会出现如下的错误

Removing unused resources requires unused code shrinking to be turned on. 

  • 解决方法
 minifyEnabled true

你可能感兴趣的:(Android 报错 :Removing unused resources requires unused code shrinking to be turned on.)