here's the code with the error
失败:构建失败,并出现异常。
位置:
脚本'/home/patto/flutter/packages/flutter_tools/gradle/flutter.gradle'行:793
出了什么问题
Execution failed for task ':app:assembleDebug'.
> FlutterPlugin$_addFlutterTasks_closure18$_closure45$_closure46$_closure47
尝试:
使用--stacktrace
选项运行以获取堆栈跟踪。使用--info
或--debug
选项运行以获取更多日志输出。与--scan
一起运行以获得完整的见解。
BUILD FAILED in 7s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 9.0s
Exception: Gradle task assembleDebug failed with exit code 1
答案 0 :(得分:1)
我今天有同样的问题。
我通过修复
flutter upgrade
然后
flutter doctor
当我再次运行Flutter应用程序时,它可以工作并且错误消失了。
这是我对flutter doctor
的输出:
Downloading Dart SDK from Flutter engine c8e3b9485386425213e2973126d6f57e7ed83c54...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 246M 100 246M 0 0 750k 0 0:05:36 0:05:36 --:--:-- 1292k
Building flutter tool...
Downloading package sky_engine... 2.6s
Downloading flutter_patched_sdk tools... 8.9s
Downloading flutter_patched_sdk_product tools... 10.9s
Downloading linux-x64 tools... 47.0s
Downloading linux-x64/font-subset tools... 4.0s
Downloading android-arm-profile/linux-x64 tools... 3.6s
Downloading android-arm-release/linux-x64 tools... 2.3s
Downloading android-arm64-profile/linux-x64 tools... 2.8s
Downloading android-arm64-release/linux-x64 tools... 2.4s
Downloading android-x64-profile/linux-x64 tools... 2.7s
Downloading android-x64-release/linux-x64 tools... 2.5s
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Android Studio (version 4.0)
如您所见,它再次构建了颤动工具,并可能通过此方法对其进行了修复。