Error running my flutter project with my andriod device

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 @1f10a584

Execution failed for task ‘:app:processDebugMainManifest’.

  • What went wrong:

FAILURE: Build failed with an exception.

Launching lib\main.dart on Redmi Note 9 Pro in debug mode…

lib\main.dart:1

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

BUILD FAILED in 15s

Exception: Gradle task assembleDebug failed with exit code 1

Exited (sigterm)