gpt4 book ai didi

visual-studio-code - 处理异常 : Process "C:\Users\...\android\gradlew.bat" exited abnormally:

转载 作者:IT王子 更新时间:2023-10-29 06:59:33 24 4
gpt4 key购买 nike

我将 Flutter 更新到了 0.11.9 版本。如果我使用 Visual Studio Code 的 Flutter 扩展创建一个新项目,然后运行“不调试开始”,我会收到此错误消息:

Launching lib\main.dart on Android SDK built for x86 in debug mode...
ProcessException: Process "C:\Users\marco\Downloads\Prova\ciao\android\gradlew.bat" exited abnormally:
Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: C:\Users\marco\.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv\gradle-4.10.2-all.zip

at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:61)

at org.gradle.wrapper.Install.createDist(Install.java:48)

at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)

at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Command: C:\Users\marco\Downloads\Prova\ciao\android\gradlew.bat -v
Exited (sigterm)

我该如何解决这个问题?谢谢!

编辑

这很奇怪,因为解决了关于 Android 许可证的问题后,如果我重新运行 flutter doctor,我会收到此消息:

[!] Android toolchain - develop for Android devices (Android SDK 28.0.1)
• Android SDK at C:\Users\marco\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.1
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
X Android license status unknown.

最佳答案

Windows gradlew.bat进行以下更改:

  • 第一个变化
    • 查找:set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
    • 替换:set CLASSPATH=<path_to_downloaded_gardle>\gradle-4.6\lib\gradle-launcher-4.6.jar
  • 第二次改变
    • 查找:"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
    • 替换:"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.launcher.GradleMain %CMD_LINE_ARGS%

关于visual-studio-code - 处理异常 : Process "C:\Users\...\android\gradlew.bat" exited abnormally:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53464362/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com