获取Android的源码

弄了一上午的android源码获取,总是不成功,在用repo init -u https://android.googlesource.com/platform/manifest这之后,repo sync总出现

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
xds@xds-Ubuntu:~/bin/myandroid$ repo sync
error: command 'sync' requires repo to be installed first


这个错误。在网上查找各种帖子,最后发现,是最开始不清楚每个步骤惹得祸。在repo初始化时,应该先切换到你新建的文件夹下。开始没怎么注意,结果初始化的.repo文件夹在主目录下,因为时隐藏的,没注意到,导致repo sync总出错。把主目录.repo文件夹删除后,重新初始化之后顺利执行

原文地址:https://www.cnblogs.com/HTWorking/p/2790570.html