如果我尝试运行示例应用程序,则会出现以下异常:
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