admin管理员组

文章数量:1608631

高效解决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/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:443 [maven.google] failed: Connection timed out: connect **

可以查看解决Connect to maven.google:443 [maven.google] failed: Connection timed out: connect 这篇文章进行解决

本文标签: 高效ConnectiontimedconnectError