android - 如何解决 Flutter 应用上的 Google Play 未优化 APK 问题?

标签 android flutter google-play apk

使用我的 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/

相关文章:

java - 在 Android Studio 中丢失对静态数据的引用

android - 在我滚动之前,RecyclerView 不会更新 child

java - 如何在查看寻呼机中的图像顶部添加文本?

debugging - Flutter 在编译发布时是否删除 Debug模式代码?

android - 精简版/专业版与应用内计费升级选项

android - 为什么我的 Button 文本在 Lollipop 上强制全部大写?

flutter - 停止监听并重新开始监听RxDart中的流

flutter - 如何获取 Firestore 文档 ID?

android - 使用无障碍服务

google-play - 在 ICS 上区分平板电脑和智能手机