同步源码,问题重现:
1 Fetching project platform/external/libopus 2 Fetching project repo 3 error: Cannot fetch repo (TypeError: expected string or buffer) 4 Fetching project CyanogenMod/android_external_tinycompress 5 Exception in thread Thread-230: 6 Traceback (most recent call last): 7 File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner 8 self.run() 9 File "/usr/lib/python2.7/threading.py", line 754, in run 10 self.__target(*self.__args, **self.__kwargs) 11 File "/home/dinphy/sm/.repo/repo/subcmds/sync.py", line 270, in _FetchProjectList 12 success = self._FetchHelper(opt, project, *args, **kwargs) 13 File "/home/dinphy/sm/.repo/repo/subcmds/sync.py", line 314, in _FetchHelper 14 prune=opt.prune) 15 File "/home/dinphy/sm/.repo/repo/project.py", line 1267, in Sync_NetworkHalf 16 no_tags=no_tags, prune=prune)): 17 File "/home/dinphy/sm/.repo/repo/project.py", line 1933, in _RemoteFetch 18 if remote.PreConnectFetch(): 19 File "/home/dinphy/sm/.repo/repo/git_config.py", line 605, in PreConnectFetch 20 return _preconnect(connectionUrl) 21 File "/home/dinphy/sm/.repo/repo/git_config.py", line 549, in _preconnect 22 m = URI_ALL.match(url) 23 TypeError: expected string or buffer
分析问题,寻找方案:
1、问题所在:主要是repo的问题,只需要重新下载repo即可。
2、下载repo需要IP代理,http://www.cnblogs.com/dinphy/p/5619854.html
3、终端输入命令重新下载repo并初始化:
#新建bin目录 mkdir ~/bin #指定路径 PATH=~/bin:$PATH #下载repo,并移动到bin目录下 curl https://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo #给repo赋予读写权限 chmod a+x ~/bin/repo
4、回到项目的目录,重新初始化源码,然后repo sync
5、OK,完美结束。