Generate Signed APK: Errors while building APK Android Studio

后端 未结 9 1965
无人共我
无人共我 2021-02-12 22:20

I am unable to generate Signed APK using minifyEnabled true and shrinkResources true

App Level : build.gradle

buildscript {
            


        
9条回答
  •  深忆病人
    2021-02-12 22:47

    First check whether you really need to use shrinkResources

    If so, do as suggested in developers link https://developer.android.com/studio/build/shrink-code.html#shrink-resources mentioned above by IntelliJ Amiya, you have to use like below

    android {
    
        buildTypes {
            release {
                shrinkResources true  // -- always add this above minifyEnabled --
                minifyEnabled true   
                proguardFiles getDefaultProguardFile('proguard-android.txt'),
                        'proguard-rules.pro'
            }
        }
    }
    

提交回复
热议问题