Gradle 同步失败:连接被拒绝 [英] Gradle sync failed: Connection refused
问题描述
所以我隔了很长时间才重新安装Android Studio,它要求我配置代理,所以我做了.我测试了连接,它工作正常.
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.
然后它让我为 Gradl 配置代理设置,我使用了相同的配置.
Then it asked me to configure the proxy settings for Gradl and I used the same configs.
现在,在加载最新的 Vuforia 示例项目时,出现错误:
Now, when loading the latest Vuforia Sample project, I get an error:
Gradle 同步失败:连接被拒绝:连接
Gradle sync failed: Connection refused: connect
我在网上到处找,但找不到解决办法.不能是代理设置,我已经像IDE一样配置了Gradle.
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.
推荐答案
您应该在 Android Studios 菜单(文件 | 设置)上配置代理设置.另一种策略是配置文件gradle.properties
.
You should configure Proxy settings on Android Studios menu (File | Settings). Another strategy is to configure the file gradle.properties
.
因此,在位于应用程序文件夹基础上的 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屋!