发生这种情况是因为您的应用程序包含Android支持库,Google Play服务或某些其他库,这些库提供了所有这些语言的字符串。
您可以在这种状态下发布应用,但是对于您不明确支持的语言,用户可能会在某些地方(例如来自Google Play服务的对话框)以其设备配置的语言查看文本,而不是在应用的默认语言。
要确保APK中仅包含所需语言环境的资源,您可以使用中的resConfigs
功能build.gradle
,例如:
android {
defaultConfig {
// Explicitly include only the languages that we support;
// ignore any other resources included by library projects
resConfigs 'de', 'en', 'fr'
}
}
实验性Gradle插件的语法如下:
model {
android {
defaultConfig {
resourceConfigurations << 'en' << 'de' << 'zh'
}
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句