ProcessException: Process “C:\..\myapp\android\gra

2020-02-13 08:15发布

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?

标签: dart flutter
9条回答
混吃等死
2楼-- · 2020-02-13 08:41

I solve this error with delete flutter sdk and download it again. Be sure that you have good internet.

查看更多
家丑人穷心不美
3楼-- · 2020-02-13 08:51

I have solved this issue by setup android project in android studio and android studio shows me error that your kotlin version is not compatible so i upgrade kotlin version.

ext.kotlin_version:   '1.2.71' ->  '1.3.50'

It started working fine.

查看更多
男人必须洒脱
4楼-- · 2020-02-13 08:54

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).
查看更多
登录 后发表回答