6

The APKs I've been creating with Eclipse lately all are being created with support for all languages even though I only support the default language.

aapt dump looks like this for the locales tag:

locales: '--_--' 'ca' 'da' 'fa' 'ja' 'nb' 'de' 'af' 'bg' 'th' 'fi' 'hi' 'vi' 'sk' 'uk' 'el' 'nl' 'pl' 'sl' 'tl' 'am' 'in' 'ko' 'ro' 'ar' 'fr' 'hr' 'sr' 'tr' 'cs' 'es' 'it' 'lt' 'pt' 'hu' 'ru' 'zu' 'lv' 'sv' 'iw' 'sw' 'fr_CA' 'lo_LA' 'en_GB' 'et_EE' 'ka_GE' 'km_KH' 'zh_HK' 'hy_AM' 'zh_CN' 'en_IN' 'mn_MN' 'pt_BR' 'es_US' 'pt_PT' 'zh_TW' 'ms_MY'

This is also being reflected in the Google Play Publisher Console as upon upload the apk lists as supporting: default + 56 languages.

Some people are saying there's a way around this if you use Android Studio. Unfortunately though, I can't move my project away from Eclipse right now.

My questions:

  1. Is there a way to fix this?
  2. Is it safe to ignore this? (e.g. will keeping this mess up my app availability, store listing, etc.)
MarmiK
  • 5,639
  • 6
  • 40
  • 49
Sheado
  • 161
  • 1
  • 7
  • 2
    Are you including any Android library projects that might have string resources for these locales? – CommonsWare Feb 20 '14 at 01:01
  • Oh man.. I didn't think of checking. It looks like google-play-services_lib has /values-... directories for each of those languages. I guess there isn't much I could do about that.. – Sheado Feb 20 '14 at 01:08
  • 2
    Yeah, the listed locales will be based off of your code and that of library projects. Long term, keep tabs on [this issue](http://code.google.com/p/android/issues/detail?id=66133), as they're looking to make it easier to constrain the APK you create via Gradle (and, hence, Android Studio) to certain languages, including stripping out strings from libraries. – CommonsWare Feb 20 '14 at 01:09

1 Answers1

8

With Android Studio and Gradle you could use this in build.gradle:

android {
    defaultConfig {
        resConfigs "en", "de", "es" //Define languages that your app supports.
    }
}
Community
  • 1
  • 1
Kuitsi
  • 1,675
  • 2
  • 28
  • 48