Chinaunix首页 | 论坛 | 博客
  • 博客访问: 23075
  • 博文数量: 9
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 65
  • 用 户 组: 普通用户
  • 注册时间: 2013-03-17 19:33
文章分类
文章存档

2013年(9)

我的朋友

分类: LINUX

2013-03-17 19:53:37

原文地址:下载android4.2源码 作者:laoyouji

PC环境:ubuntu12.10 - 64位
官方参考地址:

步骤:
1、mkdir ~/bin
2、export PATH=$PATH:~/bin
3、curl > ~/bin/repo
这时出现错误:
root@skyi:~# curl > ~/bin/repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:04:04 --:--:--     0curl: (7) Failed to connect to 2404:6800:4005:c00::5d: Network is unreachable
源码的网络不太好,试多几次就可以了。
4、cd /media/Backup/wplace/android/4.0
5、repo init -u -b android-4.2.1_r1
出现错误:
fatal:'../platform/abi/cpp.git' does not appear to be a git repository
fatal:The remote end hung up unexpectedly
error:Cannot fetch platform/abi/cpp
这个错误的原因是:用repo下载了不同的版本(可能是你没有下成功的版本)都在同一个文件夹中,把它删除就OK了(.repo),可以用ls -a查看。
成功的时候它会提示你用repo init --config-name重新命名。
以在这里查看有哪些版本可以选择:
6、repo sync
就开始下载代码了。

代码下载过程中,经常提示以下错误:

error: Failed connect to android.googlesource.com:443;Connection refused while accessing
fatal: HTTP request failed
error: Cannot fetch platform/tools/motodev
error: Cannot fetch platform/frameworks/base
error: Cannot fetch platform/prebuilts/sdk
error: Exited sync due to fetch errors

解决方法:编辑/etc/hosts文件
$ vim /etc/hosts
增加下面内容,保存:

74.125.71.82

74.125.71.82 android.googlesource.com

203.208.46.172 cache.pack.google.com

59.24.3.173cache.pack.google.com

然后重新输入

$ repo sync


阅读(2330) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~