首页 > 解决方案 > 当我发布我的应用程序颤振应用程序时,这发生在 android studio

问题描述

C:\Users\i\Desktop\New folder\Covid-19-Flutter-UI-master>flutter build apk --release
You are building a fat APK that includes binaries for android-arm, android-arm64,
android-x64.
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,android-x64
        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,android-x64
        --split-per-abi
        Learn more on:
        https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\i\Desktop\New folder\Covid-19-Flutter-UI-master\android\app\build.grad
le' line: 50

* What went wrong:
Could not compile build file 'C:\Users\i\Desktop\New folder\Covid-19-Flutter-UI-master\andr
oid\app\build.gradle'.
> startup failed:
  build file 'C:\Users\i\Desktop\New folder\Covid-19-Flutter-UI-master\android\app\build.gr
adle': 50: expecting anything but ''\n''; got it anyway @ line 50, column 15.
             "    }
                   ^

  1 error


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to g
et more log output. Run with --scan to get full insights.

Gradle task assembleRelease failed with exit code 1

C:\Users\i\Desktop\New folder\Covid-19-Flutter-UI-master>

标签: flutter

解决方案


遵循所有这些步骤:https ://flutter.dev/docs/deployment/android

Flutter 和 Android 还推荐使用 App bundle 作为首选,而不是 APK,因此flutter build appbundle请在完成所有步骤后尝试使用。


推荐阅读