Android Sync 同步 源碼問題解決方案

來源:互聯網
上載者:User

 一直很忙,忙的不可開交,以前我說有時間就來寫點東西,然後最近一直很忙,連論文,加新項目,事情挺多的,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 34ccdaa87b25c2456a76aafcf09a66b2fab236ffthinkinbunny@tib-N55SF:~/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 7d4526582f88808a3194e1a3b304abb369d2745cthinkinbunny@tib-N55SF:~/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 bce007aa754159a3c4b3894c581c53940ebc2e08thinkinbunny@tib-N55SF:~/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吧。

同步出錯就是某些檔案校正失敗,最簡單的方法就是建立一個目錄初始設定檔案覆蓋舊的,語文不及格,表的的不是很明白,將就看吧

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.