Android Studio连接被拒绝 [英] Android Studio Connection Refused

查看:829
本文介绍了Android Studio连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题:

我的gradle脚本尝试构建时出现以下错误:

I'm getting the following error when my gradle script tries to build:

> Could not resolve junit:junit:4.12.
     > Could not get resource 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
        > Could not GET 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom'.
           > Connection to https://jcenter.bintray.com refused

我需要了解的信息:

(1)如何解决Android Studio的连接问题

(1) How to resolve Android Studio's connection issue

OR

(2)手动放置.pom文件的位置

(2) Where to put the .pom files manually

我到目前为止所做的事情:

(1)在浏览器中手动访问jcenter网站并下载文件

(1) Access the jcenter website manually in a browser and download the files

(2)设置Android Studio的代理设置,并通过在终端中执行ping操作来验证与jcenter的连接

(2) Set up Android Studio's proxy settings and verified the connection to jcenter via ping in Terminal

(3)使用包括mavenCentral()maven { url 'http://repo1.maven.org/maven2' }

推荐答案

我解决了我的问题.

无论出于何种原因,Android Studio系统设置中的代理设置都没有转移到gradle构建中.我怀疑这是由于Android Studio的代理设置似乎仅提供http而我需要https所致.

For whatever reason, the proxy settings in Android Studio's System Settings wasn't transferring over into the gradle build. I suspect that it is due to the fact that Android Studio's proxy settings only seems to offer http and I needed https.

解决方案是在gradle.properties中输入我的代理设置:

The solution was to enter my proxy settings in gradle.properties:

systemProp.https.proxyHost=my.secure.proxy
systemProp.https.proxyPort=8080

这篇关于Android Studio连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆