今天用repo获取android源码:
../bin/repo init -u git://android.git.kernel.org/platform/manifest.git
出现问题:
问题一:
Traceback (most recent call last):
File "./repo", line 590, in <module>
    main(sys.argv[1:])
File "./repo", line 557, in main
    _Init(args)
File "./repo", line 176, in _Init
    _CheckGitVersion()
File "./repo", line 205, in _CheckGitVersion
    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/usr/lib/python2.5/subprocess.py", line 594, in __init__
    errread, errwrite)
File "/usr/lib/python2.5/subprocess.py", line 1147, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

原因:没有装git,faint
解决:
sudo apt-get install git
sudo apt-get install git-core

问题二:
装好了git,再次运行:
Traceback (most recent call last):
  File "/home/calvin/Android/Android2.0/source/.repo/repo/main.py", line 235, in <module>
    _Main(sys.argv[1:])
  File "/home/calvin/Android/Android2.0/source/.repo/repo/main.py", line 217, in _Main
    repo._Run(argv)
  File "/home/calvin/Android/Android2.0/source/.repo/repo/main.py", line 123, in _Run
    cmd.Execute(copts, cargs)
  File "/home/calvin/Android/Android2.0/source/.repo/repo/subcmds/init.py", line 223, in Execute
    self._ConfigureUser()
  File "/home/calvin/Android/Android2.0/source/.repo/repo/subcmds/init.py", line 165, in _ConfigureUser
    name  = self._Prompt('Your Name', mp.UserName)
  File "/home/calvin/Android/Android2.0/source/.repo/repo/project.py", line 306, in UserName
    self._LoadUserIdentity()
  File "/home/calvin/Android/Android2.0/source/.repo/repo/project.py", line 319, in _LoadUserIdentity
    u = self.bare_git.var('GIT_COMMITTER_IDENT')
  File "/home/calvin/Android/Android2.0/source/.repo/repo/project.py", line 1324, in runner
    p.stderr))
error.GitError: manifests var: 
*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident  <calvin@lihao-desktop.(none)> not allowed

解决:
看来的告知自己的身份才行。
运行:
[calvin@lihao-desktop ~/Android/Android2.0/source 18:44:28]$ git config --global user.email "lihao921@gmail.com"
[calvin@lihao-desktop ~/Android/Android2.0/source 18:44:28]$ git config --global user.name "Cavin Lee"
再运行repo:
[calvin@lihao-desktop ~/Android/Android2.0/source 18:45:00]$ ../bin/repo init -u git://android.git.kernel.org/platform/manifest.git

Your Name  [Cavin Lee]: 
Your Email [lihao921@gmail.com]:

Your identity is: Cavin Lee <lihao921@gmail.com>
is this correct [y/n]? y

Testing colorized output (for 'repo diff', 'repo status'):
  black    red      green    yellow   blue     magenta   cyan     white 
  bold     dim      ul       reverse 
Enable color display in this user account (y/n)? y

repo initialized in /home/calvin/Android/Android2.0/source(出现这个提示说明成功了)

接下来同步代码:
[calvin@lihao-desktop ~/Android/Android2.0/source 18:54:50]$ ../bin/repo sync

问题三:
同步代码时不断出现诸如 “remote end hung up unexpectedly“错误:
Fetching projects:   1% (2/158)  
Initializing project platform/bootable/bootloader/legacy ...
fatal: The remote end hung up unexpectedly
error: Cannot fetch platform/bootable/bootloader/legacy
看样子是server的问题。
解决:
参考:http://android.amberfog.com/?p=230
http://code.google.com/p/android/issues/detail?id=4488

sudo gedit  .repo/repo/subcmds/sync.py
修改_Fetch函数为:

  def _Fetch(self, projects):
    fetched = set()
    pm = Progress('Fetching projects', len(projects))
    for project in projects:
      pm.update()
      while True:
       if project.Sync_NetworkHalf():
        fetched.add(project.gitdir)
        break
       else:
        print >>sys.stderr, 'error: Cannot fetch %s' % project.name
    pm.end()
    return fetched

注意代码缩进问题,相应的代码段缩进要完全一样。

(转)获取android源码时repo的错误的更多相关文章

  1. 获取android源码时repo的错误

    今天用repo获取android源码:../bin/repo init -u git://android.git.kernel.org/platform/manifest.git出现问题:问题一:Tr ...

  2. 获取android源码中遇到的问题

    最近项目相当紧张,回家之后还需要继续研究android源码. 从网上找了一些资料,下载过程中还是遇到了很多问题.这里罗列一下: 1. 下载Repo过程中提示证书问题: curl https://dl- ...

  3. Kernel.org 被黑,获取 Android 源码方法一则

    8 月底 9 月初,作为 Linux 的老窝,Kernel.org 被黑客攻击了,其攻击原因众说纷纭.一直以来 Linux 对于我来说不是很感兴趣,所以从来不会关注类似事件,可是这次这个攻击,却影响到 ...

  4. Android源码及repo下载——亲自测试下载源码成功!

    经过一段时间煞费苦心的下载都未能成功后,如今终于把android源代码下载成功,很是兴奋! 废话不多说,直接说下步骤: 1.安装git和curl:sudo apt-get install git-co ...

  5. MacOS10.9获取Android源码不完全笔记(2014)

    第一步:安装Macports 这个我就不叙述了,网上有无数教程 第二步:创建一个磁盘镜像 1.打开磁盘工具,然后: 第三步:使用Macport安装编译环境 1.打开终端输入以下内容 sudo port ...

  6. 【转】Android 源码编译make的错误处理--不错

    原文网址:http://blog.csdn.net/ithomer/article/details/6977386 Android源码下载:官方下载 或参考android源码下载方式 Android编 ...

  7. Android源码编译make的错误处理

    android源码下载:官方下载 或参考android源码下载方式 Android编译版本: PLATFORM_VERSION=4.0.1(最新Android 4.0.1) OS 操作系统平台: Li ...

  8. android 源码编译中的错误 解决

    1.编译种错误提示: arm-none-linux-gnueabi-gcc: directory: No such file or directory arm-none-linux-gnueabi-g ...

  9. jdk/java版本与Android源码编译中的错误

    错误一:javap未指向有效的java版本 Traceback (most recent call last): File "../../base/android/jni_generator ...

随机推荐

  1. jenkins 发送邮件模板

    jenkins 发送邮件模板 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...

  2. ubuntu14.4开启ftp服务

    1 更新源列表 打开"终端窗口",输入"sudo apt-get update"-->回车-->"输入当前登录用户的管理员密码" ...

  3. cocos2dx 3.x 避免空sprite

    由于cocos2dx 3.x中autobatch的,如果场景中含有空sprite(并且还不处于visible==false状态)的话,则会打断流水线(因为空sprite的贴图与其它元素的贴图必定不在同 ...

  4. Vector3.Set的正确使用

    直接调用position.Set会发现没有用.其实和其本身是结构体有关,要当成一个值类型来看待,因为他全部是在栈中. transform.position.Set(,,); 改成这样即可: var t ...

  5. [svc]logstash和filebeat之间ssl加密

    cfssl生成证书 wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 -O /usr/local/bin/cfssl wget https://pkg ...

  6. Storm API,Tutorial,Trident,Windowing BOOKS

    http://storm.apache.org/releases/1.0.0/Trident-API-Overview.html https://stackoverflow.com/questions ...

  7. JAVA文件转换为Base64

    JAVA文件转换为Base64 import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream ...

  8. 每日英语:Secrets Of Effective Office Humor

    Margot Carmichael Lester loves making good-natured jokes at work. As owner of The Word Factory, a Ca ...

  9. 【Linux】VMware中为CentOS设置静态IP(非动态获取IP)

    在VMware上安装好Linux后,默认设置的动态IP,每次启动的IP都不同,远程连接挺费劲的. 于是,需要设置静态的IP,至少我从远程工具连接上去方便多了.另外,为了安装一些软件,也需要访问互联网. ...

  10. 【转】Mysql两种存储引擎的异同【MyISAM和InnoDB】

    MySQL默认采用的是MyISAM. MyISAM不支持事务,而InnoDB支持.InnoDB的AUTOCOMMIT默认是打开的,即每条SQL语句会默认被封装成一个事务,自动提交,这样会影响速度,所以 ...