Unable to run Flutter code in Android Studio? - java

I get an error everytime I try to run the default code that flutter provides for a new project
> java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module #0x1da59d23) 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 #0x1da59d23```
Any tips?
https://imgur.com/a/v97fcCz (I have run flutter doctor and this is the result after fixing the licenses)

Related

Ant cannot compile with cross-release process

I have a ant process to compile a java 1.8 application. Ant is lauched from Eclipse IDE in Windows running with java 1.17.
If I try to run Ant process using a separate JDK (1.8), different from the workspace one, I got this error:
I tried to run Ant with the same version of Eclipse (1.17), I had to add these attributes to <javac> element:
target="8" source="8" release="8"
The compilation starts, but it fails with this error:
java.lang.IllegalAccessError: class org.adrianwalker.multilinestring.JavacMultilineProcessor (in unnamed module #0x4778ea49) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module #0x4778ea49
The failing class (JavacMultilineProcessor) is a annotation processor class.
(http://www.adrianwalker.org/2011/12/java-multiline-string.html)
Do you have any idea what happened?
I solved with some other attributes to javac element:
<javac fork="true" executable="C:\Program Files\Java\jdk1.8.0_202\bin\javac" includeantruntime="false" ... />

Is there a way to solve this internal error in Intellij

I just wrote a simple hello world program in Intellij and this is the output when I tried to run the program.
Error:Internal error: (java.lang.IllegalAccessError) class com.intellij.util.io.FileChannelUtil (in unnamed module #0x306279ee) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module #0x306279ee

Flutter :app:processDebugMainManifest error when running app

I'm developong a flutter mobile application but whenever I try to run it, it throws the following :app:processDebugMainManifest error:
Execution failed for task ':app:processDebugMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module #7ea904ce
When I run flutter doctor the only issue is android studio not being installed (despite being installed).

Error in android development, gradle build failed

So, ever since I updated my repository from my group, I got this error, however, when I looked at the commits all that changes in the built-in files are the version of gradle and jdk. I've searched and done possible solution regarding the app:processDebugMainMAnifest and I just don't know how I can resolve this problem.
Execution failed for task ':app:processDebugMainManifest'.
Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module #645de77a

Cannot run a HelloWorld on Intellij Idea (java.lang.IllegalAccessError)

I wanted to just run HelloWorld on Intellij Idea which is failed.
Java Version is "9-ea" in my macOS.
Error:Internal error: (java.lang.IllegalAccessError) class com.intellij.util.io.FileChannelUtil (in unnamed module #0x6ecc4cd7) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module #0x6ecc4cd7
java.lang.IllegalAccessError: class com.intellij.util.io.FileChannelUtil (in unnamed module #0x6ecc4cd7) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module #0x6ecc4cd7
at com.intellij.util.io.FileChannelUtil.setupUnInterruptibleHandle(FileChannelUtil.java:26)
......
Please make sure to use the release JDK version, not ea and update to the latest IntelliJ IDEA version.
I had the same error and the solution I've found was to downgrade my Java version (JDK) from 16 to 11. Then, it worked :)

Categories

Resources