我刚刚升级了我的Android Studio,这导致我的Flutter构建过程出现问题。我现在尝试构建之前正常工作的项目时遇到了以下错误。附上我的Android Studio设置。感谢任何帮助。
错误:构建失败。
原因: 执行任务“:app:processDebugMainManifest”失败。 无法使私有最终字段java.io.File.path可访问:模块java.base未向未命名模块@4be5c282“打开java.io”。
尝试: 使用--stacktrace选项运行以获取堆栈跟踪。 使用--info或--debug选项运行以获取更多日志输出。 使用--scan运行以获取完整的洞察力。
在https://help.gradle.org获取更多帮助。
错误:构建失败。
原因: 执行任务“:app:processDebugMainManifest”失败。 无法使私有最终字段java.io.File.path可访问:模块java.base未向未命名模块@4be5c282“打开java.io”。
尝试: 使用--stacktrace选项运行以获取堆栈跟踪。 使用--info或--debug选项运行以获取更多日志输出。 使用--scan运行以获取完整的洞察力。
在https://help.gradle.org获取更多帮助。
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
[> 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 @4be5c282
[ ] * 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 4s
[ ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[ ] Use '--warning-mode all' to show the individual deprecation warnings.
[ ] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[ ] 20 actionable tasks: 4 executed, 16 up-to-date
[ +498 ms] Running Gradle task 'assembleDebug'... (completed in 5.0s)
[+1124 ms] Exception: Gradle task assembleDebug failed with exit code 1
[ +14 ms] "flutter run" took 7,187ms.
[ +15 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:663:9)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4 CommandRunner.runCommand (package:args/command_runner.dart:196:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
Android Studio北极狐|2020.3.1补丁1,构建版本#AI-203.7717.56.2031.7621141,制作于2021年8月7日,运行时版本为11.0.10+0-b96-7281165 x86_64,VM使用由JetBrains s.r.o提供的OpenJDK 64位服务器VM,在macOS 11.5.1下运行,使用G1 Young Generation和G1 Old Generation进行GC,具有1280M的内存和8个核心,外部系统自动导入已禁用,非捆绑插件为org.jetbrains.kotlin