androidandroid-studiobuildsigned-apkshrinkresources

Generate signed APK build runs forever when minifyEnabled is true


I'm trying to reduce the APK size. So as suggested by Google I used shrinkResources and it requires minifyEnabled to be true in bulid.gradle

buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
            'proguard-rules.pro'
    }
}

But the problem is once this is done, the build never ends.

enter image description here

proguard-rules.pro is empty I haven't changed anything in it. And, something called Unmanaged thread operation #-1 also appeared.

What would be the issue?


Solution

  • The build finally ended after running for 16m 17s. Although normal APK generate takes about 3 minutes, it is worth waiting because the apk size was actually reduced in about 52% compared to a normal signed apk

    normal apk  : 4585 KB
    minified apk: 2170 KB