Android Studio exports strings from support library to APK

前端 未结 1 1837
执念已碎
执念已碎 2020-12-05 00:43

Recently i switched from Eclipse to Android Studio. I have a project with multiple module dependencies. One dependency is the support library appcompat, included like this:<

相关标签:
1条回答
  • 2020-12-05 01:45

    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.

    0 讨论(0)
提交回复
热议问题