Filtering resources from the Play Services monolith to make your APK smaller

后端 未结 3 1222
花落未央
花落未央 2021-01-31 11:28

A lot has been written about the monolithic nature of the Google Play Services and why it should be split into more libraries. For now the workaround to keep your APK small is t

3条回答
  •  滥情空心
    2021-01-31 12:07

    As of version 0.14 of the Android Gradle plugin, this can be accomplished automatically as mentioned in this post:

    android {
        buildTypes {
            release {
                minifyEnabled true
                shrinkResources true
            }
        }
    }
    

    shrinkResources is a flag that tells the compiler to skip any resources that aren't referenced. minifyEnabled is the new name for runProguard, which must be enabled for shrinkResources to work.

提交回复
热议问题