Android源码下载
来源:互联网 发布:医院网络客服工资高吗 编辑:程序博客网 时间:2024/06/05 20:49
Android源码下载
最近下载android源码遇到了些问题,参考了网上一些解决办法,终于可以下了,总结如下:
1、下载repo
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo$ chmod a+x ~/bin/repo
2、下载源码
$ mkdir WORKING_DIRECTORY$ cd WORKING_DIRECTORY
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
$ repo sync
但是在下载过程经常遇到以下错误:
错误1:
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 101] Network is unreachable
错误2:
error: Failed to connect to 2404:6800:4008:c01::52: Network is unreachable while accessing https://android.googlesource.com/platform/frameworks/compile/libbcc/info/refs
fatal: HTTP request failed
错误3:
error: The requested URL returned error: 403 while accessing https://android.googlesource.com/a/platform/build/info/refs
解决方法:
1. 浏览器登录https://android.googlesource.com/new-password,并用gmail帐号登录;
此步骤可能需要$翻墙$
2. 点击网页上的“允许访问”,得到类似
3. 把上面2那段信息追加到~/.netrc文件结尾(请检查当前用户的权限, 如果不存在此文件则自己新建一个);
4. 下载地址的URI更改为https://android.googlesource.com/a/platform/manifest(中间加上了“/a”)。
5. repo init -uhttps://android.googlesource.com/a/platform/manifest-b android-4.0.1_r1
执行时需要输入用户名,此用户是步骤2得到的。
6. repo sync
如果以上方法不行,可以尝试
在.repo目录下的manifest.xml里找到fetch属性
改成
fetch= "git://Android.git.linaro.org/ "
为了防止在下载过程中出现网络异常导致无法继续下载,用下面这个脚本sync源码比较安全:
#!/bin/bash
echo"======start repo sync======"
repo sync -j2
while [ $? == 1]; do
echo"======sync failed, re-sync again======"
sleep 3
repo sync -j2
done
- Android下载Android源码
- 下载构建android源码-下载源码
- Android源码下载
- Android源码下载
- android源码下载
- android源码下载
- git 下载 android 源码
- Android 源码下载
- Android 源码下载编译
- android源码下载
- android源码下载方法
- android git 下载源码
- 如何下载android源码
- android源码下载
- android源码下载
- android源码下载
- android 源码下载
- ubuntu android 源码下载
- 黑马程序员-高新技术
- GPIB_VISA
- POST方式发送ajax请求详解
- 黑马程序员-交通灯
- 让CAS不用SSL也可以实现跨域(cas-server-3.2.1)
- Android源码下载
- maven FAQ
- 黑马程序员-银行
- Java启动子进程,子进程又启动孙进程后,Java在InputStream inputStream = process.getInputStream();中读取时,何时会返回null?
- 设置windows 宿主计算机和VMware虚拟机共享文件夹
- 《Effective C++》学习笔记条款15 在资源管理类中提供对原始资源的访问
- Tkinter 8.5 参考手册: a GUI for Python (二)
- Java Calendar 类的时间操作
- 重学微积分(一)