【Android】解决aab上传Google Play后下载语言文件缺失的问题
生活随笔
收集整理的這篇文章主要介紹了
【Android】解决aab上传Google Play后下载语言文件缺失的问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
官網(https://developer.android.com/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.com/guide/app-bundle/configure-base?hl=zh-cn
總結
以上是生活随笔為你收集整理的【Android】解决aab上传Google Play后下载语言文件缺失的问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: AMD锐龙7 7745HX和i9-129
- 下一篇: 以字母Q为元素的创意logo设…