javaandroidbuild.gradleapkandroid-studio-3.0

Failed to generate apk for my project in android studio


I am working on existing project of android app with java, i imported the project successfully and synced it with gradle successfully but getting to build apk I cale across this problem

{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 @6edd9065}

I have tried many things but still getting same error message


Solution

  • Sounds like a JDK compatibility issue. Try using a different version of JDK, like 11. You will probably have to specify the path to the jdk in local.properties. Also, have a look at this https://github.com/fluttercommunity/flutter_workmanager/issues/287#issuecomment-893476072