skip to Main Content

I am trying to run my android program in Qt however I am getting the following error:

Execution failed for task ':processDebugManifest'.
> 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 @13d72a22

I tried different versions of jdk and gradle however nothing helps.

Gradle version: 7.4.2
JDK version: 18

3

Answers


  1. 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
    

    Another option is to downgrade to JDK 17. I downgraded to openjdk version "17.0.3" 2022-04-19 and did not get the error.

    Login or Signup to reply.
  2. I got this weird error in IntelliJ when trying to build an Android project. I think the core reason was me changing the JDK version that Gradle uses in Settings -> Build, Execution, Deployment -> Build Tools -> Gradle and Gradle JVM down there at the bottom. I tried increasing that to fix something else and got this error. Just changing back to the exact version I always used seemed to fix it. This is kind of a terrible answer but I’m going to post it anyway, it might help someone.

    Login or Signup to reply.
  3. Answer for Flutter Devs

    I ran into this error in IntelliJ while trying to build a Flutter app for Android. I was updating an app I had worked on almost a year ago so the com.android.tools.build:gradle dependency in android/build.gradle was way out of date.

    Fixed by changing dependency to this:

     classpath 'com.android.tools.build:gradle:7.4.1'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search