skip to Main Content

I am trying to run my old android project in android studio i have updated my gradle version 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**

Gradle version: 7.2 JDK version: 17

I have tried gradle property value:

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

2

Answers


  1. Chosen as BEST ANSWER

    enter image description here

    I just download JDK 11 and it's compatibale with AGP 7.2 and it's working

    check Compatibility for AGL

    https://developer.android.com/build/releases/past-releases/agp-7-2-0-release-notes


  2. Solution:
    Add the below line in your 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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search