如何更正此错误:Gradle 任务 assembleDebug 失败,退出代码为 1?

时间:2021-05-25 14:52:32

标签: flutter gradle-task

谁能告诉我为什么我在android studio中一直有这个错误,我安装了最新的gradle但仍然无法修复它并且我运行了flutter doctor -v,输出如下。我也尝试过flutter clean但不能找不到重建选项。 这是错误日志:

FAILURE: Build failed with an exception.

* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

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

* Get more help at https://help.gradle.org

BUILD FAILED in 37s
Exception: Gradle task assembleDebug failed with exit code 1

这是我的 flutter doctor -v 输出:

[√] Flutter (Channel master, 2.3.0-13.0.pre.145, on Microsoft Windows [Version
10.0.19041.985], locale en-CA)
• Flutter version 2.3.0-13.0.pre.145 at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision fdb1fb184d (3 days ago), 2021-05-24 22:04:02 -0700
• Engine revision b1385c0df1
• Dart version 2.14.0 (build 2.14.0-145.0.dev)

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    X cmdline-tools component is missing
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more
      details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.2.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)

[√] Connected device (3 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • 

    Android
          8.0.0 (API 26) (emulator)
        • Chrome (web)                       • chrome        • web-javascript • Google
          Chrome 90.0.4430.212
        • Edge (web)                         • edge          • web-javascript • Microsoft
          Edge 90.0.818.66
    
    ! Doctor found issues in 1 category.

0 个答案:

没有答案