Loading...

Android Studio Error:Connection refused (Connection refused)

Error:FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'mx_app'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.2.1.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.2.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
            > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
               > Connect to 127.0.0.1:1080 [/127.0.0.1] failed: Connection refused (Connection refused)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s

 

已经配了代理127.0.0.1:1087,测试链接也OK,但是build的时候依然报错,并且通过127.0.0.1:1080去下载依赖,把代理端口改为1080即可。

还有可能是代理不支持https,下载地址改为http即可
distributionUrl=http\://services.gradle.org/distributions/gradle-5.1.1-all.zip

 

There are 3 comments

avatar

The European languages are members of the same family. Their separate existence is a myth. For science, music, sport, etc, Europe uses the same vocabulary. The European languages are members of the same family. Their separate existence is a myth.

Today, 14:55 - Reply
avatar

Europe uses the same vocabulary. The European languages are members of the same family. Their separate existence is a myth.

Today, 15:34 - Reply
avatar

The European languages are members of the same family. Their separate existence is a myth. For science, music, sport, etc, Europe uses the same vocabulary. The European languages are members of the same family. Their separate existence is a myth.

Today, 14:59 - Reply