4

修复Gradle因代理设置导致的超时问题

 3 years ago
source link: https://droidyue.com/blog/2020/04/11/fix-gradle-timeout-due-to-wrong-network-configuration/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

修复Gradle因代理设置导致的超时问题

Apr 11th, 2020

之前在项目中增加了一个项目依赖,可是配置的时候,怎么也无法下载下来。中终端执行gradle得到的错误日志如下

org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1-sources.jar'.
at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:96)
at org.gradle.internal.resource.transport.http.HttpClientHelper.performRawHead(HttpClientHelper.java:72)

怀疑是网络的问题,先后开启了***工具都无法下载。后来摸索了一段时间,才发现了问题的所在。我在gradle.properties的代理错误设置有问题

systemProp.https.proxyPort=1080
systemProp.http.proxyHost=127.0.0.1
org.gradle.jvmargs=-Xmx10240m -XX\:MaxPermSize\=4096m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8
org.gradle.daemon=true
systemProp.https.proxyHost=127.0.0.1
org.gradle.parallel=true
systemProp.http.proxyPort=1080
  • 删除或者更正相关的http和https的host和端口,问题即可解决。
droidyue_gzh_green_png.png

加入技术小黑屋官方电报群

Posted by androidyue Apr 11th, 2020android, bintray, gradle, jcenter, network, proxy

« 未合并分支不怕丢,一个脚本快速搞定 The APK file xxxx.apk does not exist on disk问题修复 »


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK