Android Studio exports strings from support library to APK

At code.google.com they say that the gradle plugin has a option to restrict resources, since version 0.7.0 is released.

Note at version 0.7.0 Release notes:

New option on product Flavor (and defaultConfig) allow filtering of
resources through the -c option of aapt

  • You can pass single value (resConfig) or multiple values (resConfigs) through the DSL.
  • All values from the default config and flavors get combined and passed to aapt.
  • See “basic” sample.

Here is some sample code to put in the build.gradle file of your project:

android {
    defaultConfig {
        resConfigs "en", "de", "es" //Define languages that your app supports.
    }
}

I spent a lot of time to find the “Basic sample”…could be a link in the release notes :/ so there are the links:

  • Gradle samples
  • Basic sample
  • Release notes

NOTE:
Version 0.7.x requires Android Studio 0.4.+ and Gradle 1.9.

Leave a Comment