使用我的 Flutter 应用时,我在 Google Play 上收到此错误
Unoptimized APK Warning:
This APK results in unused code and resources being sent to users. Your app could be smaller if you used the Android App Bundle. By not optimizing your app for device configurations, your app is larger to download and install on users' devices than it needs to be. Larger apps see lower install success rates and take up storage on users' devices.
Resolution:
Use the Android App Bundle to automatically optimize for device configurations, or manage it yourself with multiple APKs.
我已将它们添加到 android/app/build.gradle 中,但它没有解决我的问题:
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources false
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
最佳答案
确保从所有文件中删除所有不需要的代码并执行 https://flutter.dev/docs/deployment/android这也许可以尝试“flutter build appbundle”。 另外,删除应用不需要的权限。
关于android - 如何解决 Flutter 应用上的 Google Play 未优化 APK 问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56643675/