当前位置: 代码迷 >> Android >> Android Sync 同步 源码有关问题解决方案
  详细解决方案

Android Sync 同步 源码有关问题解决方案

热度:536   发布时间:2016-05-01 10:08:57.0
Android Sync 同步 源码问题解决方案

android源码还是很久以前下载的,今天sync发现突然不行了,报错: error.GitError: device/common rev-list ('^7d4526582f88808a3194e1a3b304abb369d2745c', 'HEAD', '--'): fatal: bad object 7d4526582f88808a3194e1a3b304abb369d2745c

result = cmd.Execute(copts, cargs)  File "/home/thinkinbunny/mydroid/.repo/repo/subcmds/sync.py", line 466, in Execute    project.Sync_LocalHalf(syncbuf)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1007, in Sync_LocalHalf    lost = self._revlist(not_rev(revid), HEAD)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1785, in _revlist    return self.work_git.rev_list(*a, **kw)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1930, in rev_list    p.stderr))error.GitError: platform/development rev-list ('^34ccdaa87b25c2456a76aafcf09a66b2fab236ff', 'HEAD', '--'): fatal: bad object 34ccdaa87b25c2456a76aafcf09a66b2fab236ff[email protected]:~/mydroid$ ./repo syncFetching projects: 100% (247/247), done.  Syncing work tree:   4% (10/247)  Traceback (most recent call last):  File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 385, in <module>    _Main(sys.argv[1:])  File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 365, in _Main    result = repo._Run(argv) or 0  File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 137, in _Run    result = cmd.Execute(copts, cargs)  File "/home/thinkinbunny/mydroid/.repo/repo/subcmds/sync.py", line 466, in Execute    project.Sync_LocalHalf(syncbuf)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1007, in Sync_LocalHalf    lost = self._revlist(not_rev(revid), HEAD)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1785, in _revlist    return self.work_git.rev_list(*a, **kw)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1930, in rev_list    p.stderr))error.GitError: device/common rev-list ('^7d4526582f88808a3194e1a3b304abb369d2745c', 'HEAD', '--'): fatal: bad object 7d4526582f88808a3194e1a3b304abb369d2745c[email protected]:~/mydroid$ ./repo syncFetching projects: 100% (247/247), done.  Syncing work tree:  10% (25/247)  Traceback (most recent call last):  File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 385, in <module>    _Main(sys.argv[1:])  File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 365, in _Main    result = repo._Run(argv) or 0  File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 137, in _Run    result = cmd.Execute(copts, cargs)  File "/home/thinkinbunny/mydroid/.repo/repo/subcmds/sync.py", line 466, in Execute    project.Sync_LocalHalf(syncbuf)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1007, in Sync_LocalHalf    lost = self._revlist(not_rev(revid), HEAD)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1785, in _revlist    return self.work_git.rev_list(*a, **kw)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1930, in rev_list    p.stderr))error.GitError: platform/docs/source.android.com rev-list ('^bce007aa754159a3c4b3894c581c53940ebc2e08', 'HEAD', '--'): fatal: bad object bce007aa754159a3c4b3894c581c53940ebc2e08[email protected]:~/mydroid$ ./repo syncFetching projects: 100% (247/247), done.  Traceback (most recent call last):  File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 385, in <module>    _Main(sys.argv[1:])  File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 365, in _Main    result = repo._Run(argv) or 0  File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 137, in _Run    result = cmd.Execute(copts, cargs)  File "/home/thinkinbunny/mydroid/.repo/repo/subcmds/sync.py", line 466, in Execute    project.Sync_LocalHalf(syncbuf)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1007, in Sync_LocalHalf    lost = self._revlist(not_rev(revid), HEAD)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1785, in _revlist    return self.work_git.rev_list(*a, **kw)  File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1930, in rev_list    p.stderr))error.GitError: platform/external/bluetooth/bluez rev-list ('^5477d33e187d66961453399c53093bd18297013e', 'HEAD', '--'): fatal: bad object 5477d33e187d66961453399c53093bd18297013e

?

多次尝试无果,google之,发现google group上有这个问题,很多人问,不过都是不了了之,以前吧,百度过这个问题,在这个神奇的过度,人人都学会了CC和CV,然后就是,说是删 除.repo目录,总之有点扯淡,删除了repo跟重新下载有什么区别呢?扯淡啊。可恶的bug。

?新建了目录重新下载,最近狗日的宽带通吃屎,速度老慢。我可不想在假期下载一天源码。

?

?

?折腾了一个上午,发现了解决方案。其实很简单,android源码实际上还是用git下载的。至于repo是什么东东,自己查呗,不浪费资源了。

其本来有图,无奈windows发不了图。

我就说说基本解决方法:

? 除了repo .repo其余的都删除,cts之类的什么删除就行了,不需要心疼,前提是你的网络通,至于出现bad object,原因不晓得,感觉是东西太老的,无法替换掉,删除了这些,sync会重新冲repo目录拷贝解析出来。如果删除了repo,后果就是你要重 新下载 了。应该很长时间的。至于repo下面的东西没什么影响,但是不要删除了,不然更新就蛋疼了

? 最近遇到了一个大麻烦,发现以上的办法不管用了,最近换了房子,没网,要答辩了,把本子带公司,打算收拾下,顺便更新代码出错了,不记录了,没法重现了。

提供一个终极方案:

? 比如原来捏到源码目录是mydroid,现在新建一个droid

?

$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo$ chmod a+x ~/bin/repo

?

 repo init -u https://android.googlesource.com/platform/manifest

稍等,这个目录下面会有一个隐藏目录 repo,把这个目录全部复制mydroid覆盖就行,然后droid就没用了,然后再更新,这样是最省事的,网速牛逼的非要把repo删除也没办法,对于ip的并发google做了限制的。不能下载的

repo init -u https://android.googlesource.com/a/platform/manifest

只能这样下载了http://source.android.com/source/downloading.html 仔细阅读这个就好了。至于repo的各种问题可以说是bug吧。

同步出错就是某些文件校验失败,最简单的方法就是新建一个目录初始化文件覆盖旧的,语文不及格,表的的不是很明白,将就看吧

  相关解决方案