Search code examples
androidandroid-gradle-pluginapkicu4j

how to remove the ICU4J library from Android Studio


After creating an Android Studio project, the ICU4J library will be added to the project Automatically.it increases the APK file size to 15 MB. I do not use this library, but I can not delete it.

You can see inside the APK Analyzer too: APK Analyzer for ICU4J library

How to remove the ICU4J library from the project


Solution

  • Check your Gradle file dependencies if there is dependency to icu4j remove it or if you are not using icu4j you can add

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

    in your build configurations to remove unused code from your application.

    or You can find shrinking code and resources documentation