Skip to content

Remove Unused Language Resources

If you are using a library that includes language resources, your APK includes all translated language strings for the messages in those libraries whether the rest of your app is translated to the same languages or not.

If you'd like to keep only the languages that your app officially supports, you can specify those languages using the resConfig property. Any resources for languages not specified are removed.

The following snippet shows how to limit your language resources to just English and Russian:

build.gradle
1
2
3
4
5
6
android {
    defaultConfig {
        ...
        resConfigs "en", "ru"
    }
}

Source: https://developer.android.com/studio/build/shrink-code#unused-alt-resources

Next Steps