下载Android源代码时,出现这个错误
错误信息
out after 300022 milliseconds
Fetching projects: 100% (454/454), done.
Syncing work tree: 56% (255/454) error: unable to create file tests/P_str_escape/str\\escape.rs (No such file or directory)
Traceback (most recent call last):
File "/home/Toby/mydroid/.repo/repo/main.py", line 531, in <module>
_Main(sys.argv[1:])
File "/home/Toby/mydroid/.repo/repo/main.py", line 507, in _Main
result = repo._Run(argv) or 0
File "/home/Toby/mydroid/.repo/repo/main.py", line 180, in _Run
result = cmd.Execute(copts, cargs)
File "/home/Toby/mydroid/.repo/repo/subcmds/sync.py", line 821, in Execute
project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
File "/home/Toby/mydroid/.repo/repo/project.py", line 1327, in Sync_LocalHalf
self._InitWorkTree(force_sync=force_sync)
File "/home/Toby/mydroid/.repo/repo/project.py", line 2486, in _InitWorkTree
raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree
这个文件应该创建在下面的目录中
frameworks\compile\slang\tests\P_str_escape
出现错误时,这个目录下是没有str这个目录的,我们可以创建这个str目录,然后在str目录中创建一个名为escape.rs的空文件。然后再次运行同步命令:
repo sync
这个问题被顺利解决。
参考文章:
http://blog.csdn.net/u013553529/article/details/50616725
https://github.com/Microsoft/BashOnWindows/issues/124