这是我在构建应用程序时遇到的错误:
You are building a fat APK that includes binaries for android-arm, android-arm64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Initializing gradle... 0.5s
Resolving dependencies... 2.0s
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 79.9s
Gradle task assembleRelease failed with exit code 1
这是flutter run -v命令的输出: https://controlc.com/3bc5e348
谢谢。
答案 0 :(得分:1)
该错误显然为您提供了两种构建APK的选择。如果您尝试将其上传到Play商店,则创建应用程序捆绑可能是最好的选择。只需按照错误指示生成应用程序包:
flutter build appbundle --target-platform android-arm,android-arm64
这将在您的发行文件夹-<app dir>/build/app/outputs/bundle/release/app.aab
然后您应该可以将此aab文件上传到Play商店。
上面错误消息中的第二个选项将生成两个APK(一个用于32位,一个用于64位)。
关于此的更多信息-Flutter site
祝你好运!