admin管理员组文章数量:1604646
官网(https://developer.android/guide/app-bundle?hl=zh-cn)有对aab的描述:
Google Play 会使用您的 App Bundle 针对每种设备配置生成并提供经过优化的 APK,因此只会下载特定设备所需的代码和资源来运行您的应用。
有些手机只内置了中文、英文等几种,如果从Google Play下载应用,那么Google Play会剔除掉其他(它认为是多余的)语言资源文件,从而导致应用切换语言不成功。
解决方法:
gradle那里可以配置是否需要动态分发的内容。
android {
...
// Instead, use the bundle block to control which types of configuration APKs
// you want your app bundle to support.
bundle {
language {
// Specifies that the app bundle should not support
// configuration APKs for language resources. These
// resources are instead packaged with each base and
// feature APK.
enableSplit = false
}
density {
// This property is set to true by default.
enableSplit = true
}
abi {
// This property is set to true by default.
enableSplit = true
}
}
}
如上,language enableSplit = false
代表aab不进行分包处理,Google Play下载apk后,语言资源文件是完整的。
更多 Android App Bundle的配置,可查看官网文档:
https://developer.android/guide/app-bundle/configure-base?hl=zh-cn
版权声明:本文标题:【Android】解决aab上传Google Play后下载语言文件缺失的问题 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1728464081a1159250.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论