android源码下载(上)

本文详细记录了解决Android源码下载过程中遇到的网络连接超时问题,包括使用不同仓库地址、调整manifest文件配置等方法。同时,介绍了如何在下载过程中遇到仓库不存在特定分支时的解决方案,以及在使用repo工具进行同步时遇到的错误处理。

    同repo一样,最初下载android源码时,按照官网操作很顺利,目前下载也会报各种错误,总结如下:

1.官网下载源码方法:repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1

但是可能是公司网络原因,https://android.googlesource.com/platform/manifest网页打不开,运行 时,在

Getting manifest ...
from https://android.googlesource.com/platform/manifest处报错:

error: Connection timed out after 300035 milliseconds while accessing https://android.googlesource.com/platform/manifest/info/refs

fatal: HTTP request failed
fatal: cannot obtain manifest https://android.googlesource.com/platform/manifest

貌似是链接超时,因此到高通网站上下载:

$repo init -u git://codeaurora.org/platform/manifest.git -bandroid-4.0.1_r1

报错:error: revision android-4.0.1_r1 in manifests not found

原因是远程仓库不包含android-4.0.1_r1分支,可以使用下面的命令来下载:

$repo init -u git://codeaurora.org/platform/manifest.git -b refs/tags/android-4.0.1_r1


2.$repo init -u git://codeaurora.org/platform/manifest.git

sync时,报错:
android.git.kernel.org[0: 149.20.4.77]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)

原因:./repo/manifeset.xml中fetch="git://android.git.kernel.org/",即高通也是从git://android.git.kernel.org/下载源码。上篇文章已提到,该网站被黑了。。。

./repo/manifeset.xml中fetch="git://android.git.kernel.org/"改为fetch="git://Android.git.linaro.org/",重新sync.

或改用$repo init -u git://codeaurora.org/platform/manifest.git

注:使用repo下载时,出现:

From git://codeaurora.org/quic/qrd-android/platform/build
 * [new branch]      etrump-globalization -> caf/etrump-globalization
 * [new branch]      gingerbread-qrd-1050-release -> caf/gingerbread-qrd-1050-release
 * [new branch]      ics_qrd_qs -> caf/ics_qrd_qs
 * [new branch]      jb_qrd_es  -> caf/jb_qrd_es
 * [new branch]      jb_rel_qrd -> caf/jb_rel_qrd
 * [new branch]      jb_rel_rb5_qrd -> caf/jb_rel_rb5_qrd
 * [new tag]         R7227TCNCJNLYA71542301 -> R7227TCNCJNLYA71542301
 * [new tag]         R7227TCNCJNLYA71542302 -> R7227TCNCJNLYA71542302
 * [new tag]         R7627UCNSKNLYA105012 -> R7627UCNSKNLYA105012
 * [new tag]         R7627UCNSKNLYA106822 -> R7627UCNSKNLYA10
显示的是服务器上该仓库的远程仓库中所包含的分支与tag。


3.

$repo init -u git://codeaurora.org/platform/manifest.git -b refs/tags/android-4.0.1_r1

报错:

../platform/bionic.git' does not appear to be a git repository

    fatal: The remote end hung up unexpectedly 
    error: Cannot fetch platform/bionic*
好像与repo有关,使用以前保存的./tools/repo,问题解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值