Android studio错误Connect to 127.0.0.1:1087 [/127.0.0.1] failed: Connection refused

编译的时候出现如下提示

Connect to 127.0.0.1:1087 [/127.0.0.1] failed: Connection refused

查找配置文件

网上找到的是代理配置问题,找到本地用户的根目录下的gradle.properties文件,例如

电脑用户名/.gradle/gradle.properties

需要注意的是mac系统下要打开隐藏文件才能看到

// 显示隐藏文件(关闭把true改成false)
defaults write com.apple.finder AppleShowAllFiles -boolean true;killall Finder
image.png

删除代理信息

删除这四个属性:
systemProp.https.proxyPort
systemProp.http.proxyHost
systemProp.http.proxyPort
systemProp.https.proxyHost

之后记得关闭 显示隐藏文件

image.png

你可能感兴趣的:(Android studio错误Connect to 127.0.0.1:1087 [/127.0.0.1] failed: Connection refused)