I was facing some issue, with my flutter app. And after upgrading the Gradle version I started facing this issue. And i couldn't find anything close to this, after googling. But later I solved it from a different issue. SO I decided to create a issue for someone who's looking up this same issue.
Bcz I had no idea what to try. I was almost lost.
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 @36297cd9
To solve the issue, you have to add this line to your gradle.properties file.
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
And your grade.properties file should look something like this ->

For me, it solved the issue. And then I had a different issue. But for that I just updated my kotlin version inside android/build.gradle file. And then, finally my project ran.
If anyone knows this issue in depth, and wants to explain the situation a bit more, I would really appreciate it. Thank you 😊💚
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