我是 Flutter 框架的新手,并使用 adb 在我的浏览器和我的物理设备中尝试了默认代码,效果很好,但是当我尝试获取 apk 文件时,出现了无法解决的错误。我已经按照官方文档进行构建和发布。这是日志:
E:\Android Applications\myapp>flutter build apk --release
Building with sound null safety
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processReleaseMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessib
le: module java.base does not "opens java.io" to unnamed module @70cb5dd9
* 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 5s
Running Gradle task 'assembleRelease'... 7.5s
Gradle task assembleRelease failed with exit code 1
请帮我修正这个错误。注意:我确实安装了 JDK 和 JRE,工作正常并添加到路径中。我也配置了 build.gradle
文件。