同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
好像与repo有关,使用以前保存的./tools/repo,问题解决。
本文详细记录了解决Android源码下载过程中遇到的网络连接超时问题,包括使用不同仓库地址、调整manifest文件配置等方法。同时,介绍了如何在下载过程中遇到仓库不存在特定分支时的解决方案,以及在使用repo工具进行同步时遇到的错误处理。
&spm=1001.2101.3001.5002&articleId=8161706&d=1&t=3&u=2498111dbc7d4d8a873258f1cab0d429)
5658

被折叠的 条评论
为什么被折叠?



