ProcessException: Process "C:\Users\User\Desktop\Courses\flutter\myapp\android\gradlew.bat" exited abnormally:
Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: C:\Users\User\.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\User\Desktop\Courses\flutter\myapp\android\gradlew.bat -v
When i run my flutter app from vs code it shows this error, what is wrong here?
Open gradlew.bat file in edit mode in the new window of android studio and resolve the gradle issue. I Just delete gradle-4.10.2-all and rebuild my project.
Here are the steps that I followed to solve the problem.
run
flutter run
on the command prompt given by your OS(not by the vs code shell).make sure you have a good internet connection.
add multiDexEnabled true might work
This might help if you have license problem.
flutter doctor
on command prompt. If you get this: ! Some Android licenses not accepted.flutter doctor --android-licenses
and accept all the licenses.flutter run
and you are good to go.Delete
.gradle
the folder inC:\Users***.gradle
in Windows or/Users/xxxx/.gradle
in Mac , connect to the internet, rebuild project to download the latest Gradle.For me, the problem was that my internet connection could not download the Gradle binaries while initializing Gradle. I suspect it's because I'm behind a proxy.
Try downloading it and installing it manually.
GRADLE_HOME
to point to this location.GRADLE_HOME/bin
to yourPATH
environment variable.