Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle相关的知识,希望对你有一定的参考价值。

参考技术A 后面查到说是Jcenter() 和google()被墙了,需要在前面加上Maven()
具体解决如下:
buildscript
repositories
maven url ' http://maven.aliyun.com/nexus/content/groups/public/'
google()
jcenter()


allprojects
repositories
maven url ' http://maven.aliyun.com/nexus/content/groups/public/'
google()
jcenter()


通过添加上述maven(),程序运行成功

ping: unknown host解决办法

ping: unknown host解决办法

 

如果ping命令返回如下错误,那主要的可能性就是系统的DNS设置有误。

[cpp] 

[[email protected] ~]# ping www.sina.com.cn  

ping: unknown host www.sina.com.cn  

可以通过如下方法来解决,此方法已经在linux和solaris系统下通过验证。

1) 确定设置了域名服务器

没有的话, 建议设置Google的公共DNS服务, 它应该不会出问题的

[cpp] 

# cat /etc/resolv.conf  

-------------------------------------------------------------------  

nameserver 8.8.8.8  

nameserver 8.8.4.4  

-------------------------------------------------------------------  

2) 确保路由表正常

[cpp] 

[[email protected] ~]# netstat -rn  

Kernel IP routing table  

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface  

192.168.128.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0  

169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0  

0.0.0.0         192.168.128.2   0.0.0.0         UG        0 0          0 eth0  

如果未设置, 则通过如下方式增加网关:

[cpp] 

# route add default gw 192.168.128.2  

3) 确保可用dns解析(这步常忘了)

[cpp] 

# grep hosts /etc/nsswitch.conf  

-------------------------------------------------------------------  

hosts:      files dns  

-------------------------------------------------------------------   

注意,上面的配置要加上dns。

以下是dns的配置,备忘。

hosts: dns files

表示只在DNS失效时候才使用/etc/hosts文件

 

hosts: dns 

表示只用DNS解析主机

 

host: files 

表示只用/etc/hosts文件解析主机

 

hosts: files dns

将使用/etc/hosts文件解析主机,表示如果无法解析主机名将使用DNS。


以上是关于Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle的主要内容,如果未能解决你的问题,请参考以下文章

win7:2005-Unknown MySQL server host 'localhost'(0)

Error-MySQL:2005 - Unknown MySQL server host 'localhost'

navicat报错2005 - Unknown MySQL server host 'localhost' 原因及解决方法

关于MySQL错误 2005 - Unknown MySQL server host 'localhost' 原因及解决方法

Navicat for MySQL打开链接时出错错误为:2005 - Unknown MySQL server host 'localhost'?

redis.exceptions.ResponseError: unknown command `KEYS`