问题描述:参照google文档说明:http://source.android.com/source/downloading.html 一步一步设置,
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo $ chmod a+x ~/bin/repo
$ mkdir WORKING_DIRECTORY $ cd WORKING_DIRECTORY
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
$ repo sync
一切很顺利,只是每次下到5G左右后就结束了:
log大致如下:
然后界面就一直停在这,第一次下android源码,也不知道怎么才算成功,看这提示貌似成功了,到源码目录ls一下,傻眼了 啥也没有,空空如也,再ll,有一个.repo文件夹,这个文件夹的文件大小大约就5G,也就是说我下了半天就只下了个.repo文件夹。
找log,没有发现任何异常,google一遍,基本上大家都是按google官方文档步骤就下载成功了,遇到的一些问题跟我的情况也都不一致,
抑郁了,反复看http://source.android.com/source/downloading.html 里的描述,也没发现什么,无奈之下,查了一遍软件版本:
repo --version
... A new repo command ( 1.18) is available.
... You should upgrade soon:
cp /home/xxxx/bin/.repo/repo/repo /home/xxxx/bin/repo
repo version v1.11.1
(from https: // gerrit.googlesource.com/git-repo)
repo launcher version 1.17
(from /home/xxxx/bin/repo)
git version 1.7.5.4
Python 2.7.2+ ( default, Jul 20 2012, 22:15:08)
[GCC 4.6.1]
gnu make 版本:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-pc-linux-gnu
我的jdk版本是1.6 看这版本也符合,google文档要求的版本为:
Detailed instructions for Ubuntu and MacOS follow. In general you will need:
Python 2.5 -- 2.7, which you can download from python.org.
GNU Make 3.81 -- 3.82, which you can download from gnu.org,
JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older. You can download both from java.sun.com.
Git 1.7 or newer. You can find it at git-scm.com.
这一切都符合,只有结果不符合。
看看真个过程,似乎都很完美,只是有一个提示:
... You should upgrade soon:
google文档里没有说要求repo的版本,我的repo版本是1.17
看到有这么个提示,想想把repo升级了看看吧。
于是使用如下命令:
repo init --repo-url https://android.googlesource.com/tools/repo -u http://android.googlesource.com/platform/manifest -b android-2.3.3_r1
这个命令比google文档里的多了一个参数:
--repo-url https://android.googlesource.com/tools/repo
它强制升级repo版本,
重新下载一遍,我成功的看到以下日志:
* [ new branch] ics-plus-aosp -> aosp/ics-plus-aosp
f37f794..f6e5b79 jb-dev -> aosp/jb-dev
* [ new branch] jb-mr0-release -> aosp/jb-mr0-release
f787b1d..1e1589a jb-release -> aosp/jb-release
* [ new tag] android-4.1.1_r1 -> android-4.1.1_r1
* [ new tag] android-4.1.1_r1.1 -> android-4.1.1_r1.1
* [ new tag] android-4.1.1_r2 -> android-4.1.1_r2
* [ new tag] android-4.1.1_r3 -> android-4.1.1_r3
* [ new tag] android-4.1.1_r4 -> android-4.1.1_r4
* [ new tag] android-4.1.1_r5 -> android-4.1.1_r5
* [ new tag] android-4.1.1_r6 -> android-4.1.1_r6
* [ new tag] android-4.1.1_r6.1 -> android-4.1.1_r6.1
* [ new tag] android-4.1.2_r1 -> android-4.1.2_r1
* [ new tag] android-cts-4.1_r1 -> android-cts-4.1_r1
Fetching projects: 100% (165/165), done.
Checking out files: 100% (4679/4679), done.out files: 45% (2126/4679)
Checking out files: 100% (4573/4573), done.out files: 15% (696/4573)
Checking out files: 100% (10008/10008), done.t files: 2% (287/10008)
Checking out files: 100% (11980/11980), done.t files: 0% (6/11980)
Checking out files: 100% (5169/5169), done. out files: 49% (2544/5169)
Checking out files: 100% (985/985), done.ng out files: 10% (105/985)
Checking out files: 100% (297/297), done.ng out files: 2% (8/297)
Checking out files: 100% (684/684), done.ng out files: 41% (283/684)
Checking out files: 100% (9601/9601), done. out files: 1% (172/9601)
Checking out files: 100% (1328/1328), done.
Syncing work tree: 100% (165/165), done.
查看源码目录,多了几个工程:
bionic bootable build cts dalvik development device external frameworks hardware libcore Makefile ndk packages prebuilt sdk system