升级 android studio 破坏了我的颤振构建(macOS)
Posted
技术标签:
【中文标题】升级 android studio 破坏了我的颤振构建(macOS)【英文标题】:Upgrading android studio broke my flutter build (macOS) 【发布时间】:2021-10-23 20:52:39 【问题描述】:我刚刚升级了我的 android studio,它破坏了我的颤振构建过程。我现在在尝试构建以前工作的项目时遇到此错误。最后是我的安卓工作室设置。感谢您对此的任何帮助。
FAILURE:构建失败并出现异常。
出了什么问题: 任务“:app:processDebugMainManifest”执行失败。 无法使字段私有 final java.lang.String java.io.File.path 可访问:模块 java.base 不会“打开 java.io”到未命名的模块 @4be5c282
尝试: 使用 --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 虚拟机:JetBrains s.r.o 的 OpenJDK 64 位服务器虚拟机。 macOS 11.5.1 GC:G1年轻代,G1老年代 内存:1280M 核心:8 注册表:external.system.auto.import.disabled=true 非捆绑插件:org.jetbrains.kotlin
【问题讨论】:
这里也一样,兄弟。找到任何解决方案了吗? 我有问题插件“Dart”自构建 203.5981 以来不兼容 我将我的 java 降级到 11 并且它工作正常。不知道为什么 【参考方案1】:在 SDK Tools 下更新 Android SDK Tools 和 NDK 后,我能够解决我的问题。
【讨论】:
【参考方案2】:我遇到了同样的问题并解决了安装 JDK。
去Project Structure -> Platform Settings -> SDKs
,选择一个平台,然后Java SDK
,并下载最新的(你可以下载你应该在你的项目中使用的那个)。
【讨论】:
以上是关于升级 android studio 破坏了我的颤振构建(macOS)的主要内容,如果未能解决你的问题,请参考以下文章
将 Android Studio Gradle 升级到 6.1.1 会破坏 Greendao3GradlePlugin
异常:Gradle 任务 assembleDebug 失败,退出代码为 1,Visual Studio 代码