gradle Flutter抛出错误,等待独占访问文件时超时X:grad尔

qvk1mo1f  于 2022-11-14  发布在  Flutter
关注(0)|答案(1)|浏览(170)
Launching lib\main.dart on SM G615F in debug mode...
lib\main.dart:1
Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: C:\Users\Me\.gradle\wrapper\dists\gradle-6.7-all\cuy9mc7upwgwgeb72wkcrupxe\gradle-6.7-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)
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: C:\Users\Shaad\.gradle\wrapper\dists\gradle-6.7-all\cuy9mc7upwgwgeb72wkcrupxe\gradle-6.7-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)
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

你能帮我解决这个问题吗?我正在获取Gradle任务 assembleDebug 错误,也当我在物理设备上运行Flutter时,它需要这么多时间来运行和执行。
我想在这方面寻求帮助。

1dkrff03

1dkrff031#

这可能是由于损坏的gradle安装或缓慢的互联网。

解决方案

删除位于Windows的**.gradle文件夹:C:\Users\<user>\.gradleMac**:/home/<user>/.gradle
然后再次运行Flutter应用程序。
由于将再次下载gradle依赖项,因此可能需要更长时间。请不要断开您的设备。

相关问题