gpt4 book ai didi

android - 如何用android studio解决flutter中的gradle错误?

转载 作者:行者123 更新时间:2023-12-03 03:39:55 24 4
gpt4 key购买 nike

我安装了具有 Flutter 的所有要求的 android studio,当我运行 flutter doctor 时,一切都很好并且安装正确。我创建了一个普通的 android 项目,它运行良好,没有错误。现在,在我创建了新的 flutter 项目后,每当我运行该项目时都会出现此错误。
我无法解决它。

Launching lib\main.dart on Android SDK built for x86 in debug mode... Initializing gradle... Finished with error: ProcessException: Process "C:\Users\Nesma\AndroidStudioProjects\flutter_app\flutter_apptest\android\gradlew.bat" exited abnormally: Downloading 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:\Users\Nesma\AndroidStudioProjects\flutter_app\flutter_apptest\android\gradlew.bat -v

最佳答案

问题是因为您没有 gradle-4.10.2-all版本,当你运行它时试图下载它但没有成功。

如果您已经使用 gradle 创建了另一个项目,您可以检查您拥有的版本:C:\Users\{USERNAME}\.gradle\wrapper\dists\并修改新项目的 gradle 配置。

关于android - 如何用android studio解决flutter中的gradle错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57745729/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com