Android aab包多语言缺失

问题描述

需要上架Google或者华为的aab包后,假如你的应用有多语言切换,有时上架成功后再下载发现切换不了多语言,那是因为在分包的时候导致多语言资源缺失了,这时候需要对app的build.gradle文件进行配置

解决方法

android {
    // When building Android App Bundles, the splits block is ignored.
    splits {...}

    // 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
        }
    }
}

更详细的配置参考:https://developer.android.com/guide/app-bundle/configure-base?hl=zh-cn

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容