Gradle 任务 assembleDebug 失败,flutter 上的退出代码为 1

时间:2021-05-21 18:14:10

标签: flutter android-studio visual-studio-code

如果我尝试运行示例应用程序,则会出现以下异常:

Launching lib\main.dart on sdk gphone x86 in debug mode...
lib\main.dart:1

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x3f6a5431) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x3f6a5431

* 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 6s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

有人知道如何解决这个问题吗? 我已经试过了

flutter clean
flutter create .
flutter pub get

flutter clean
flutter upgrade
flutter pub get
flutter pub upgrade

github 上的回购:https://github.com/capoaira/flutter-test

0 个答案:

没有答案