高效解决Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy
当打开别人的项目的时候,有时候会运行不起来,会报次错误,因此在这里记录一下
第一步:修改gradle的版本
-
打开gradle-wrapper.properties然后将项目中的gradle的版本改成自己本地下载好的(可以找个已经成功运行的项目进行复制),我这里换成了我本地已经可以运行项目的gradle
#Fri Jan 07 11:39:43 CST 2022 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip -
打开项目根目录下的build.gradle,修改对应的classpath,我这里修改成了
-
dependencies { classpath 'com.android.tools.build:gradle:3.6.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }
第二步
然后Try Again就ok了,如何按照上面的解决办法还是会报错**Connect to maven.google.com:443 [maven.google.com] failed: Connection timed out: connect **
可以查看解决Connect to maven.google.com:443 [maven.google.com] failed: Connection timed out: connect 这篇文章进行解决
本文记录了解决打开项目时遇到的Error: Connection timed out错误的步骤。首先,更新gradle-wrapper.properties文件中的gradle版本,将其改为本地已知可用的版本。接着,修改项目根目录下build.gradle中对应classpath为3.6.0。如果仍然出现连接Google Maven失败的错误,可参考相关文章进一步解决。

2439

被折叠的 条评论
为什么被折叠?



