如何使用Android Studio解决抖动中的gradle错误()

努力尽今夕,少年犹可夸。这篇文章主要讲述如何使用Android Studio解决抖动中的gradle错误?相关的知识,希望能为你提供帮助。
我安装了具有flutter的所有要求的android studio,当我运行flutter doctor时,一切都很好,并且安装正确。我创建了一个普通的android项目,它运行正常,没有错误。现在,在创建新的flutter项目之后,每当我运行该项目时,都会出现此错误。我无法解决。

在调试模式下为x86构建的Android SDK上启动libmain.dart ...正在初始化gradle ...错误完成:ProcessException:进程“ C: UsersNesmaAndroidStudioProjectsflutter_appflutter_apptestandroidgradlew.bat”异常退出:正在下载https://services.gradle.org/distributions/gradle-4.10.2-all.zip
Exception in thread "main" java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 503 Too many open connections" at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2142) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183) at sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2729) at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2641) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1824) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263) at org.gradle.wrapper.Download.downloadInternal(Download.java:58) at org.gradle.wrapper.Download.download(Download.java:44) at org.gradle.wrapper.Install$1.call(Install.java:61) at org.gradle.wrapper.Install$1.call(Install.java:48) at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) 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:UsersNesmaAndroidStudioProjectsflutter_appflutter_apptestandroidgradlew.bat -v

答案问题是因为您没有gradle-4.10.2-all版本,并且在运行该版本时试图下载它没有成功。
【如何使用Android Studio解决抖动中的gradle错误()】如果您已经使用gradle创建了另一个项目,则可以检查C:Users{USERNAME}.gradlewrapperdists中的版本,并修改新项目的gradle配置。

    推荐阅读