File "/Volumes/android/.repo/repo/main.py", line 531, in _Main(sys.argv[1:]) 解决方法

repo sync 过程出现以下这种问题时,只需删除涉及的目录重新执行repo sync即可。在我这个例子里我只需删除platform/prebuilts/ 或者 platform/prebuilts/devtools 目录,重新执行repo sync 即可完成代码同步。

Traceback (most recent call last):
  File "/Volumes/android/.repo/repo/main.py", line 531, in
    _Main(sys.argv[1:])
  File "/Volumes/android/.repo/repo/main.py", line 507, in _Main
    result = repo._Run(argv) or 0
  File "/Volumes/android/.repo/repo/main.py", line 180, in _Run
    result = cmd.Execute(copts, cargs)
  File "/Volumes/android/.repo/repo/subcmds/sync.py", line 821, in Execute
    project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
  File "/Volumes/android/.repo/repo/project.py", line 1363, in Sync_LocalHalf
    lost = self._revlist(not_rev(revid), HEAD)
  File "/Volumes/android/.repo/repo/project.py", line 2501, in _revlist
    return self.work_git.rev_list(*a, **kw)
  File "/Volumes/android/.repo/repo/project.py", line 2700, in rev_list
    (self._project.name, str(args), p.stderr))
error.GitError: platform/prebuilts/devtools rev-list ('^d054448a1147fc5294089b6ac7aa3abe92202761', 'HEAD', '--'): fatal: bad object HEAD

你可能感兴趣的:(Android)