Gradle同步失败:连接被拒绝 [英] Gradle sync failed: Connection refused

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

问题描述

因此,我在很长一段时间后再次安装了Android Studio,并要求我配置代理,所以我做了。我测试了连接并且它工作。

然后它要求我配置Gradl的代理设置,并使用相同的配置。



现在,加载最新的Vuforia示例项目时,出现错误:


Gradle同步失败:拒绝连接: connect


我在网上到处寻找,但找不到解决方案。它不能是代理设置,我像配置IDE一样配置了Gradle。

Android Studios菜单(文件|设置)。另一种策略是配置文件 gradle.properties

因此,请在位于应用程序文件夹库中的 gradle.properties 结尾处添加这些行。






  systemProp.http.proxyPassword = [PASSWORD] 
systemProp。 http.proxyHost = [IP ADDRESS]
systemProp.https.proxyPort = [PORT,通常为3128]
systemProp.https.proxyUser = [USERNAME]
systemProp.https.proxyHost = [IP ADDRESS ]
systemProp.https.proxyPassword = [PASSWORD]
systemProp.http.proxyPort = [PORT,通常3128]
systemProp.http.proxyUser = [USERNAME]

请注意,具有特殊字符的密码和其他值必须具有斜杠字符,例如( \#)等等。


So I just installed Android Studio again after a long time and it asked me to configure the proxy, so I did. I tested the connection and it worked.

Then it asked me to configure the proxy settings for Gradl and I used the same configs.

Now, when loading the latest Vuforia Sample project, I get an error:

Gradle sync failed: Connection refused: connect

I've looked everywhere on the web, but I can't find a solution. It can't be the proxy settings, I've configured Gradle just like the IDE.

解决方案

You should configure Proxy settings on Android Studios menu (File | Settings). Another strategy is to configure the file gradle.properties.

So, add theses lines for the end of gradle.properties located on the app folder base.


systemProp.http.proxyPassword=[PASSWORD]
systemProp.http.proxyHost=[IP ADDRESS]
systemProp.https.proxyPort=[PORT, TYPICALLY 3128]
systemProp.https.proxyUser=[USERNAME]
systemProp.https.proxyHost=[IP ADDRESS]
systemProp.https.proxyPassword=[PASSWORD]
systemProp.http.proxyPort=[PORT, TYPICALLY 3128]
systemProp.http.proxyUser=[USERNAME]

Pay attention, the passwords and others values that have special chars must have slash character such as (\#) and so on.

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

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