Background
Problem Description But every time I try to run and build (I want to emulator as of now), I get the following error message.
Unable to make field private final java.lang.String java.io.File.path accessible: 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 @42760a00
Here is my config set-up:
Andrey Dernov commented 14 Apr 2021 00:18 Please use Gradle 7.0 or JDK less than 16 version for importgin and building the project (Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Gradle JVM option).
Any suggestion or idea?
The solution from GitHub has worked for me. It was no need to downgrade Java JDK. Just changed gradle version in gradle-wrapper properties to 7.1.1 (6.x does not support java 16), and adding the following line in gradle.properties:
org.gradle.jvmargs=-Xmx1536M --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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With