flutter run Launching lib/main.dart on V2060 in debug mode...
FAILURE: Build failed with an exception.
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 @686d592a
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 23s Running Gradle task 'assembleDebug'... 25.2s Exception: Gradle task assembleDebug failed with exit code 1
This error I'm facing.
How to solve this in MacOs.
I had same error in one of my project. Turned out, that after updating some libraries and build toolchain (gradle, etc), build started to demand newer Java version. I updated JDK from 8 to 11 at that time and it helped.
But it is 2024 now :) I think, that you should maybe update JDK to 17 or even newer. Here is useful link for that:
JDK
, Gradle
and other tools. Example link for Android Gradle Plugin 8.3.0 (you can change numbers in it for your release): https://developer.android.com/build/releases/past-releases/agp-8-3-0-release-notesSo, this is a little puzzle :) Wish you luck in solving it.