Tab
键即可使用它的提示) Google Play
,一开始开发有梦记的时候, 没有想过国际化, 所以就在界面上硬编码了文字bug
同时, 增加了国际化(包括服务端), 可以让用户自己选择语言.Google Play
账号的时候需要支付25
美元, 可以去淘宝搜一下代付aab
格式 https://developer.android.com/guide/app-bundle/faq?hl=zh-cnGoogle Play
的上架流程还是很人性化的, 跟着提示一步一步走即可Flutter
打包aab
格式相对来说也很简单, 只要运行flutter build appbundle
即可flutter build appbundle --dart-define=channel=google
aab
格式, 不是很熟悉, 导致很多分包之后运行不了, 所以在build.gradle
增加以下代码/// 获取渠道参数使用,这里设置一下默认值
def dartEnvironmentVariables = [
// 这里尽量不使用默认值,确保总是拿到命令行参数
channel: '_channel',
]
if (project.hasProperty('dart-defines')) {
dartEnvironmentVariables = dartEnvironmentVariables + project.property('dart-defines')
.split(',')
.collectEntries { entry ->
def pair = new String(entry.decodeBase64(), 'UTF-8').split('=')
[(pair.first()): pair.last()]
}
}
android {
if (dartEnvironmentVariables.channel == "google") {
// 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 = false
}
abi {
// This property is set to true by default.
enableSplit = false
}
}
}
}