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