ubuntu更新android代码连接不上解决方法

1,Android SDK无法更新或repo文件无法下载:

解决方法:(如果hosts文件只读,则用sudo打开)

$ gedit /etc/hosts  
在打开的 /etc/hosts 在文件的末尾添加下面一句:

74.125.237.1 dl-ssl.google.com

 

2,在使用repo sync下载cm源码时提示以下错误:

error: Failed connect to android.googlesource.com:443;Connection refused while accessinghttps://android.googlesource.com/a/platform/frameworks/base/info/refs

fatal: HTTP request failed

error: Cannot fetch platform/tools/motodev

error: Cannot fetch platform/frameworks/base

error: Cannot fetch platform/prebuilts/sdk

error: Exited sync due to fetch errors

解决方法:编辑/etc/hosts文件

$ gedit /etc/hosts  

增加下面内容,保存:

74.125.31.82 www.googlesource.com
74.125.31.82 android.googlesource.com
203.208.46.172 cache.pack.google.com
59.24.3.173 cache.pack.google.com

地址可能会变,ping 地址能通才有用

posted @ 2013-08-07 13:01  行云有影  阅读(900)  评论(0编辑  收藏  举报