为什么初始化gradle不起作用?

时间:2019-08-16 12:08:37

标签: android android-studio flutter

im试图运行我的第一个flutter应用程序并停留在此错误上

Launching lib\main.dart on SM A510F in debug mode...
Initializing gradle...
Finished with error: ProcessException: Process "C:\Users\DELL\Desktop\flutter_app1\android\gradlew.bat" exited abnormally:
Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: C:\Users\DELL\.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\DELL\Desktop\flutter_app1\android\gradlew.bat -v

1 个答案:

答案 0 :(得分:0)

尝试清除干净,然后迁移到androidX。

在AS中的应用程序文件夹上单击鼠标右键,然后单击Refractor->迁移到androidX

大多数gradle问题都可以通过迁移到androidX来解决