如何将 APK 的拆分对应物从 Flutter 添加到 Google Play 商店?
How can I add APK's split counterparts from Flutter to Google Play Store?
我完成了一个flutter应用,想发布到商店,但它是一个小应用,体积很大。
当我 运行: flutter build apk
我得到了一个大小为 20MB 的 APK。
我试过了:flutter build apk --split-per-abi
,我得到了这 3 个 APK 中的 3 个:
✓ Built build/app/outputs/apk/release/app-armeabi-v7a-release.apk (7.0MB).
✓ Built build/app/outputs/apk/release/app-arm64-v8a-release.apk (7.3MB).
✓ Built build/app/outputs/apk/release/app-x86_64-release.apk (7.5MB).
当我尝试将它们添加到商店时,我无法上传超过 1 个文件。
如何将这些 APK 上传到 google Play 商店?
对于 Play 商店,您应该构建一个不带“--split-per-ab”的 APK
尝试将此代码放入 gradle :
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.test.test"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' // this one as policy changes
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}
最好以应用程序包格式构建您的应用程序,因为这是 Google PlayStore 的首选格式。只需 运行 在您的终端中执行此命令
flutter build appbundle
关于缩小已发布应用的大小,您可以向 android 应用添加混淆配置。按照 Medium 上的这些说明在您的应用上启用混淆。
但是,R8 is the new code shrinker from Google, and it’s enabled by default when you build a release APK or AAB. Google removed the obfuscation configurations from the Flutter: Build and release an Android app site and now show R8. But I found the old page here 展示了如何启用 Proguard 和 obfuscation/and 缩小
我不能对 R8 说太多,但在将您的应用程序提交到 PlayStore 之前,请随时阅读 Flutter: Build and release an Android app。
我完成了一个flutter应用,想发布到商店,但它是一个小应用,体积很大。
当我 运行: flutter build apk
我得到了一个大小为 20MB 的 APK。
我试过了:flutter build apk --split-per-abi
,我得到了这 3 个 APK 中的 3 个:
✓ Built build/app/outputs/apk/release/app-armeabi-v7a-release.apk (7.0MB).
✓ Built build/app/outputs/apk/release/app-arm64-v8a-release.apk (7.3MB).
✓ Built build/app/outputs/apk/release/app-x86_64-release.apk (7.5MB).
当我尝试将它们添加到商店时,我无法上传超过 1 个文件。
如何将这些 APK 上传到 google Play 商店?
对于 Play 商店,您应该构建一个不带“--split-per-ab”的 APK
尝试将此代码放入 gradle :
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.test.test"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' // this one as policy changes
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}
最好以应用程序包格式构建您的应用程序,因为这是 Google PlayStore 的首选格式。只需 运行 在您的终端中执行此命令
flutter build appbundle
关于缩小已发布应用的大小,您可以向 android 应用添加混淆配置。按照 Medium 上的这些说明在您的应用上启用混淆。
但是,R8 is the new code shrinker from Google, and it’s enabled by default when you build a release APK or AAB. Google removed the obfuscation configurations from the Flutter: Build and release an Android app site and now show R8. But I found the old page here 展示了如何启用 Proguard 和 obfuscation/and 缩小
我不能对 R8 说太多,但在将您的应用程序提交到 PlayStore 之前,请随时阅读 Flutter: Build and release an Android app。