2

I am trying to install flutter to my new computer. Everything seems fine in flutter doctor but when i run my app I get an error.

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

How can i fix this . Please help

1 Answer 1

2

You can run your project by opening Android module in Android studio. Go to

Tools->Flutter->Open for Editing in Android Studio

Why are you facing this error?

Gradle 6 is not fully compatible with java 16. Use Java 11 will resolve the issue. Download JDK 11 64 bit version and uninstall the current version of java.

You can check your java version by running java -version in command line interface.

Note: Java 11 is ideal at this date (10 june,2021) so far.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.