I was uploading a new version of my app when I saw this:
I have most certainly NOT added all these languages. They're not and never were among my values-xx
folders where strings.xml
are. I have tried inspecting the APK but the string resources are not there, I think they were all compiled into a single file.
Is it a new feature of Play Developer Console, or is it a bug in my app? Should I publish or not?
This happens because your app includes the Android support libraries, Google Play Services, or some other library, which provide strings for all of these languages.
You can publish the app in this state, but for the languages that you do not explicitly support, it's possible that users might see text in their device's configured language in some places (e.g. dialogs coming from Google Play Services), rather than in your app's default language.
To ensure only resources for the locales that you want are included in your APK, you can use the resConfigs
feature in your build.gradle
, for example:
android {
defaultConfig {
// Explicitly include only the languages that we support;
// ignore any other resources included by library projects
resConfigs 'de', 'en', 'fr'
}
}
The syntax for experimental Gradle plugin is as follows:
model {
android {
defaultConfig {
resourceConfigurations << 'en' << 'de' << 'zh'
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With