Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ProcessException: Process "C:\..\myapp\android\gradlew.bat" exited abnormally:

Tags:

flutter

dart

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?

like image 756
Henok Tesfaye Avatar asked Nov 14 '18 12:11

Henok Tesfaye


4 Answers

The problem is with your gradle installation, for linux users:

  1. Navigate to .gradle folder in your Home directory
  2. Open wrapper/dists and you'd find all your gradle installation
  3. If you find just one delete it and re-run your dart code from vs-code
  4. Ensure you have a good internet as the process would try to download a new gradle.
  5. In case you have more than one gradle installed go back to vs-code and take note of what version of gradle it is complaining about.
  6. Delete that version and re-run your dart code (don't forget to get a good internet).
like image 159
Oladapo Ajala Avatar answered Nov 02 '22 21:11

Oladapo Ajala


Here are the steps that I followed to solve the problem.

  1. run flutter run on the command prompt given by your OS(not by the vs code shell).

  2. make sure you have a good internet connection.

like image 31
Henok Tesfaye Avatar answered Nov 02 '22 21:11

Henok Tesfaye


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.

  1. Download the latest Gradle version.
  2. Extract the ZIP file to a location on your PC, i.e C:\Gradle
  3. add the environment variable GRADLE_HOME to point to this location.
  4. add GRADLE_HOME/bin to your PATH environment variable.
like image 6
Koby Douek Avatar answered Nov 02 '22 20:11

Koby Douek


This might help if you have license problem.

  1. run flutter doctor on command prompt. If you get this: ! Some Android licenses not accepted.
  2. run flutter doctor --android-licenses and accept all the licenses.
  3. now run flutter run and you are good to go.
like image 2
Rajneesh kumar Singh Avatar answered Nov 02 '22 21:11

Rajneesh kumar Singh