【问题标题】:I am getting error when I try to run my flutter project当我尝试运行我的颤振项目时出现错误
【发布时间】:2022-07-07 22:41:35
【问题描述】:

当我尝试运行我的颤振项目时,在编译时出现以下错误

FAILURE: Build failed with an exception.

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

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\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 9m 8s
Exception: Gradle task assembleDebug failed with exit code 1

这是我使用flutter doctor 命令的输出

[√] Flutter (Channel stable, 2.10.0, on Microsoft Windows [Version 10.0.19041.264], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Chrome - develop for the web
[!] Visual Studio - develop for Windows (Visual Studio Build Tools 2017 15.9.47)
    X Visual Studio 2019 or later is required.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.68.1)
[√] Connected device (3 available)
[√] HTTP Host Availability

我已经运行flutter upgrade,但在降级到我现在的版本之前仍然遇到同样的问题

我还删除了 pubspec.lock 文件并运行 flutter pub get,仍然出现同样的错误。

请问怎么解决这个错误,我搞了这么久了

【问题讨论】:

    标签: flutter


    【解决方案1】:

    运行 flutter clean , 关闭IDE, 重启电脑, 开放思想, 运行 flutter pub get , 跑扑跑,

    【讨论】:

    • 我也试过了,还是一样的错误
    猜你喜欢
    • 2021-12-24
    • 2021-12-16
    • 2021-05-13
    • 2022-11-25
    • 2020-02-20
    • 1970-01-01
    • 2021-08-10
    • 2018-11-23
    • 2019-09-23
    相关资源
    最近更新 更多