今天用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的错误

    获取android源码时repo的错误 今天用repo获取android源码:../bin/repo init -u git://android.git.kernel.org/platform/man ...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

随机推荐

  1. I2C的读写操作实验

    [实验任务]   利用24C08断电以后存储的数据不消失的特点,可以做一个断电保护装置.首先利用单片机做一个0-99秒的自动计时器.然后随机关断电源,在 通电以后计时器接着断电前的状态继续计时. [实 ...

  2. Android 给TextView添加点击事件

    首先设定TextView的clickable属性为true. 可以在布局文件中进行设定,比如: <TextView android:id="@+id/phone" andro ...

  3. Create XHR

    var createXHR = function() { var xhr, last_e; var PROGIDS = [ "Msxml2.XMLHTTP.6.0", //&quo ...

  4. 谈B2B电商平台与大数据

    数据为王,服务为本——谈B2B电商平台与大数据 2013-06-27 11:10:41 作者:B2B行业资讯 标签:                             大数据           ...

  5. [LeetCode] 179. Largest Number 解题思路

    Given a list of non negative integers, arrange them such that they form the largest number. For exam ...

  6. HDFS文件读取详解

    客户端与HDFS文件读取 创建HDFS文件系统实例 FileSystem fs = FileSystem.get(new URI("hdfs://ns1"), new Config ...

  7. java笔记5之逻辑运算符以及&&与&的区别

    1 &逻辑与:有false则false.         |逻辑或:有true则true.         ^逻辑异或:相同为false,不同为true.            举例:情侣关系 ...

  8. Linux查找yum安装软件在系统中路径

    find文件查找http://www.ruanyifeng.com/blog/2009/10/5_ways_to_search_for_files_using_the_terminal.html

  9. assertion的语法和语义

    .1) 语法表示 在语法上,为了支持assertion,Java增加了一个关键字assert.它包括两种表达式,分别如下: assert expression1; assert expression1 ...

  10. Qt的Graphics-View框架和OpenGL结合详解

    Qt的Graphics-View框架和OpenGL结合详解 演示程序下载地址:这里 程序源代码下载地址:这里 这是一篇纯技术文,介绍了这一个月来我抽时间研究的成果. Qt中有一个非常炫的例子:Boxe ...