skip to Main Content

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 @786f3609
enter image description here

2

Answers


  1. Choose JDK Location to lower than Java 16, as it is not supported in Android studio as of now.

    Login or Signup to reply.
  2. Adding --add-opens=java.base/java.io=ALL-UNNAMED to your JAVA_OPTS environment variable or the org.gradle.jvmargs gradle property will resolve this issue with Java 18.

    Here is the full org.gradle.jvmargs gradle property value that I’m using:

    org.gradle.jvmargs = -Xmx2048M -Dkotlin.daemon.jvm.options="-Xmx2048M" --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search