How can i force Android to not use certain language files that are within a used library project?

92 Views Asked by At

I have a library project with several language files, mainly strings. In one app I need to use the library but I want to use only some of the language files (contract reasons).

How can I force Android to disregard the existance of languages when building the app ?

1

There are 1 best solutions below

2
On BEST ANSWER

If you are using Android Studio, add a resConfigs line to your build.gradle file, to limit the packaging system to only include your desired languages:

android {
    // other stuff

    defaultConfig {
        // other stuff
        resConfigs "en", "de", "fr", "es"
    }
}

See Cyril Mottier's "Putting your APKs on a Diet" post for more.