I understand your problem, the easy solution is to remove all extra languages from the library but, you need to do it with every new version of Google Play Services, and as you says, if you need other languages in other apps, that wouldn't be the best option.
Instead try to force to your app to use German or English as default:
You need to add this code in your Application class
@Override
public void onCreate() {
super.onCreate();
avoidOtherLanguages();
// your code here
}
@Override
public void onConfigurationChanged() {
super.onConfigurationChanged();
avoidOtherLanguages();
// your code here
}
public void avoidOtherLanguages() {
if (!Locale.getDefault().getLanguage().equals(Locale.GERMAN.getLanguage()))
{
// when other than german, use english
final Configuration configuration = getResources().getConfiguration();
configuration.locale = Locale.ENGLISH;
getResources().updateConfiguration( configuration, getResources().getDisplayMetrics() );
}
}
I hope it works for you!
** UPDATED: SOLUTION **
Hi come up with a solution after a lot of googling! If you are using gradle as build system you can do this in your build.gradle file:
.....
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 75
versionName "1.0.0"
resConfigs "en", "de"
}
...
use resConfig to tell gradle that you are only using these locales configuration, all other languages in your libraries will be stripped out of the APK bundle!
Let me know if that worked for you!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…