V
V
Valentine2021-08-20 18:38:58
Java
Valentine, 2021-08-20 18:38:58

When I run the project on the emulator, I get Execution failed for task ':app:compileDebugJavaWithJavac', how can I solve it?

Full version of the error:

Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x11415676) 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 @0x11415676


Versions:
Flutter 2.2.3
Dart 2.13.4
JDK 16.0.2
Pixel 4 emulator 28 API

611fcc6809bdd916722975.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2021-08-20
Hasanly @azerphoenix

Good evening.
Try first to look at the answers that were on different resources on this issue.
For example,
https://github.com/gradle/gradle/issues/15538
https://github.com/gradle/gradle/issues/16641
Google

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question