获取android源码中遇到的问题

最近项目相当紧张,回家之后还需要继续研究android源码。

从网上找了一些资料,下载过程中还是遇到了很多问题。这里罗列一下:

1. 下载Repo过程中提示证书问题:

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

curl: (60) SSL certificate problem: unable to get local issuer certificate

More details here: http://curl.haxx.se/docs/sslcerts.html
 
curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option../bin/repo: 行 1: 未预期的符号 `newline' 附近有语法错误
./bin/repo: 行 1: `<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
'
 
从baidu搜索到:
在验证证书的时候出现问题,是本地ssl判别证书太旧,导致报ssl证书错误
下载新的ssl本地判别文件
     wget http://curl.haxx.se/ca/cacert.pem
 并更名为ca-bundle.crt放置到默认目录
      mv cacert.pem ca-bundle.crt  | mv ca-bundle.crt /etc/pki/tls/certs/
 或者curl  –cacert cacert.pem 方式指定调用
 
这里参考了一个网友的做法:
将https换成http链接进行下载,OK
 
2.  ./bin/repo: 行 1: 未预期的符号 `newline' 附近有语法错误
  ./bin/repo: 行 1: `<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
'
 
由于
服务器无法访问导致android的源码无法下载,这是另外一个git服务器的android源码的repo文件。

操作如下

$ curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" > ./repo //获取repo

$ chmod a+x repo

 3. repo sync,出现“fatal: '../platform/abi/cpp.git' does not appear to be a git repository”
 
解决办法 :
  打开.repo目录下的manifest.xml文件(命令vim manifest.xml),并找到fetch属性,在我的文件中显示fetch="..",将fetch修改为fetch="git://android.git.linaro.org/",OK
 
原文地址:https://www.cnblogs.com/caidi/p/3475950.html