Connect to 127.0.0.1:1080 [/127.0.0.1] failed:
https://www.jianshu.com/p/25ad6d80dc7c
-------------------------------------
Android Studio 常见 Connect to 127.0.0.1:1080 [/127.0.0.1] failed: Connection refused: connect 问题处理

0.152019.02.20 11:15:13字数 173阅读 4,278
下载资源做sync操作的时候,有时会遇到这种问题:
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.github.dcendents:android-maven-gradle-plugin:1.3.
Required by:
project :
> Could not resolve com.github.dcendents:android-maven-gradle-plugin:1.3.
> Could not get resource 'https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.3/android-maven-gradle-plugin-1.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.3/android-maven-gradle-plugin-1.3.pom'.
> Connect to 127.0.0.1:1080 [/127.0.0.1] failed: Connection refused: connect
相信大家看见这个问题,本能反应就是有本地代理导致 AS 获取资源的时候远端服务器访问不到。不出意外,都会想到需要删除项目根目录 gradle.properties 内的代理配置,来解决这个问题:
systemProp.https.proxyPort=1080
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=1080
但是,如果这样还没有解决的话
那就需要我们去 gradle 默认全局配置里去删除掉代理配置了,对应位置
Windows 在:C:\Users\Administrator.gradle下的gradle.properties中
Mac 在:/Users/.{你的用户目录}/.gradle下的gradle.properties中
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 25岁的心里话
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
2019-05-08 anguar @input绑定的属性变化
2019-05-08 body element height id small, but the backgroud color is full screen
2015-05-08 js 中ajax请求时设置 http请求头中的x-requestd-with= ajax
2015-05-08 javascript 私有方法的实现