Welcome 微信登录

首页 / 操作系统 / Linux / 解决下载Android源码时遇到的 download error

我下载和编译环境Ubuntu 12.04 64位 lenovo thinkpad i3 2G最近要做 Android 的浏览器插件 要用到 android 的源码 参与编译(不是指 framework 层源码)按照 google 的官网设置会出现在下载的时候产生错误 从而不能下载之前Android的代码是在Linux kernel(android.git.kernel.org)管理,被Kernel踢出来之后,Android源码现在直接由Google(android.googlesource.com)管理。用repo/git下载源码时,执行1 $ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.3_r1会报错误 异常为1 DownloadError: android.googlesource.com: <urlopen error [Errno 110] Connection timed out>解决方法1. 浏览器登录https://android.googlesource.com/new-password,并用gmail帐号登录;2. 点击网页上的“允许访问”,得到类似1 machine android.googlesource.com login git-<userName>.gmail.com password <password> 2 machine android-review.googlesource.com login git-<userName>.gmail.com password <password>3. 把上面那段信息追加到~/.netrc文件结尾(请检查当前用户的权限, 如果不存在此文件则自己新建一个);4. 下载地址的URI更改为https://android.googlesource.com/a/platform/manifest(中间加上了“/a”)。5. repo init -u https://android.googlesource.com/a/platform/manifest -b android-2.3.3_r16. repo sync即可拉下Android源码。官方的说法是:因为访问基本是匿名的,为了防止连接过多(指内网/虚拟机),对同一IP地址的连接数做了一定的限制。看来是用gmail帐号进行认证。这样的话,在公司网络内或者用虚拟机下载的话,会经常遇到这问题。源码官网指导网址: http://source.android.com/source/downloading.html更多Ubuntu相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2更多Android相关信息见Android 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=11Git初学的学习笔记Android4.2源码下载过程相关资讯      Android download error  本文评论 查看全部评论 (0)
表情: 姓名: 字数