Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

java - Gradle task assembleDebug failed with exit code 1 (Runtime Exception)

while starting a flutter application on vs code i am getting the following errors.

Launching libmain.dart on RMX1801 in debug mode... Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: C:Userssanjay.gradlewrapperdistsgradle-5.6.2-all9st6wgf78h16so49nn74lgtbbgradle-5.6.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) [!] Gradle threw an error while trying to update itself. Retrying the update... Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: C:Userssanjay.gradlewrapperdistsgradle-5.6.2-all9st6wgf78h16so49nn74lgtbbgradle-5.6.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) [!] Gradle threw an error while trying to update itself. Retrying the update... Gradle task assembleDebug failed with exit code 1 Exited (sigterm)

I am not getting why this is occurring . What can be the reason for this and how can this be solved?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It is caused by the Gradle distribution version used. To fix this, either downgrade your Gradle version to the previous or upgrade it to the next stable one. These are the Gradle distribution versions available.

Go to

android / gradle / wrapper / gradle-wrapper.properties

and replace the current Gradle version this (or choose another from Gradle distribution)

distributionUrl=https://services.gradle.org/distributions/gradle-6.0.1-all.zip

screenshot

I upgraded my Gradle version from 5.6.2 to 6.0.1, and it works fine with me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...