使用repo同步android源时的UnicodeDecodeError

时间:2017-02-15 08:58:51

标签: android git android-source repo

为什么我在抓取时遇到以下错误?

error: Cannot fetch LineageOS/android_build (UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 37: ordinal not in range(128))
Fetching project platform/hardware/intel/audio_media
Exception in thread Thread-140:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/media/chirag/SSD/android/system/.repo/repo/subcmds/sync.py", line 270, in _FetchProjectList
    success = self._FetchHelper(opt, project, *args, **kwargs)
  File "/media/chirag/SSD/android/system/.repo/repo/subcmds/sync.py", line 314, in _FetchHelper
    prune=opt.prune)
  File "/media/chirag/SSD/android/system/.repo/repo/project.py", line 1271, in Sync_NetworkHalf
    self._InitMRef()
  File "/media/chirag/SSD/android/system/.repo/repo/project.py", line 2364, in _InitMRef
    self._InitAnyMRef(R_M + self.manifest.branch)
  File "/media/chirag/SSD/android/system/.repo/repo/project.py", line 2370, in _InitAnyMRef
    cur = self.bare_ref.symref(ref)
  File "/media/chirag/SSD/android/system/.repo/repo/git_refs.py", line 57, in symref
    self._EnsureLoaded()
  File "/media/chirag/SSD/android/system/.repo/repo/git_refs.py", line 64, in _EnsureLoaded
    self._LoadAll()
  File "/media/chirag/SSD/android/system/.repo/repo/git_refs.py", line 85, in _LoadAll
    self._ReadLoose('refs/')
  File "/media/chirag/SSD/android/system/.repo/repo/git_refs.py", line 133, in _ReadLoose
    self._ReadLoose(prefix + name + '/')
  File "/media/chirag/SSD/android/system/.repo/repo/git_refs.py", line 133, in _ReadLoose
    self._ReadLoose(prefix + name + '/')
  File "/media/chirag/SSD/android/system/.repo/repo/git_refs.py", line 137, in _ReadLoose
    self._ReadLoose1(p, prefix + name)
  File "/media/chirag/SSD/android/system/.repo/repo/git_refs.py", line 155, in _ReadLoose1
    ref_id = ref_id.decode()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 37: ordinal not in range(128)

Fetching projects:  27% (158/584)  Fetching project LineageOS/android_hardware_qcom_display
Fetching projects:  28% (164/584)  Fetching project LineageOS/android_hardware_qcom_display
Fetching project LineageOS/android_hardware_qcom_display

error: Exited sync due to fetch errors

我应删除哪个特定文件夹才能再次获取该文件夹?我尝试删除android/system/build,但事实证明这是徒劳的尝试。

1 个答案:

答案 0 :(得分:1)

在我的情况下,我在macOS下,删除所有.DS_Store文件后,问题消失了,这是我使用的命令:

find . -name .DS_Store | xargs rm

希望它有所帮助!