Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploading a new version of the app to Google Play, Developer Console says "69 languages added"

Tags:

I was uploading a new version of my app when I saw this:

enter image description here

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?

like image 233
Violet Giraffe Avatar asked Sep 23 '16 14:09

Violet Giraffe


1 Answers

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'
        }
    }
}
like image 185
Christopher Orr Avatar answered Sep 26 '22 16:09

Christopher Orr