1.使用国内镜像下载
There is error when repo init -u https://android.googlesource.com/platform/manifest according to the google website <https://source.android.com/setup/build/downloading>
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 101] Network is unreachable
使用google无法下载,需要使用https://aosp.tuna.tsinghua.edu.cn/platform/manifest
2. 下载步骤
2.1步骤
#mkdir ~/bin
#PATH=~/bin:$PATH
#curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
#chmod a+x ~/bin/repo
#mkdir android9
#cd android9
#git config --global user.name "jason"
#git config --global user.email "jason@xxxx.com"
#repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-9.0.0_r3
#repo sync -j12
2.2问题
(1)repo: 是一个python脚本,可能出现
fatal: error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)
解决方法:
$ sudo update-ca-certificates --fresh
$ export SSL_CERT_DIR=/etc/ssl/certs
(2)fatal: unable to access 'https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest/': server certificate verification failed. CAfile: none CRLfile: none
解决:
$export GIT_SSL_NO_VERIFY=1
(3)如何查android分支
https://source.android.com/setup/start/build-numbers#source-code-tags-and-builds(要翻墙)
(4)无法checkout
repo sync 表示从服务器下载代码,无法checkout表示还没有下载完.
如果没有下载完,需要手动去下载:
方法: 先删除掉为下载完的目录,在指定该目录下载
step1: rm device/google/bramble-kernel
step2: repo sync device/google/bramble-kernel –force-sync
step3:rm device/google/bramble-kernel/.git/index.lock
step4: repo sync device/google/bramble-kernel –force-sync
(5)如单独下载单个project
1、打开.repo/manifiest.xml文件(这是隐藏文件夹,可用Ctrl+h显示)
2、找到所要下载的project,使用path或者name字段的值都可以,直接跟在repo sync后作为参数即可。