我到系统是ubuntu 12.04 32位

按照 google 的官网设置会出现在下载的时候产生错误 从而不能下载

之前Android的代码是在Linux kernel(android.git.kernel)管理,被Kernel踢出来之后,Android源码现在直接由Google(android.googlesource)管理。
用repo/git下载源码时,执行

1 $ repo init -u https://android.googlesource/platform/manifest -b android-2.3.3_r1

会报错误 异常为

1 DownloadError: android.googlesource: <urlopen error [Errno 110] Connection timed out>

解决方法

1. 浏览器登录https://android.googlesource/new-password,并用gmail帐号登录;

2. 点击网页上的“允许访问”,得到类似

1 machine android.googlesource login git-<userName>.gmail password <password>  2 machine android-review.googlesource login git-<userName>.gmail password <password>

3. 把上面那段信息追加到~/rc文件结尾(请检查当前用户的权限, 如果不存在此文件则自己新建一个);

4. 下载地址的URI更改为https://android.googlesource/platform/manifest

5. repo init -u https://android.googlesource/platform/manifest -b android-2.3.3_r1

6. repo sync

即可下载Android源码。

官方的说法是:因为访问基本是匿名的,为了防止连接过多(指内网/虚拟机),对同一IP地址的连接数做了一定的限制。看来是用gmail帐号进行认证。


分享一个很好到指导信息,用源码官网指导网址:http://source.android/source/downloading.html


更多推荐

android 源码下载错误: [Errno 110] Connection timed out