android源码下载报错
各位大虾:
小弟刚刚准备下载android源码,重新下载几次都没有解决问题,还是报的如下错误。
目前,本人采用的是VMware 7.1.4的虚拟机,安装的ubuntu 10.04,分配的内存是1G,硬盘是60G .但是不知为啥每次都报的是DownloadError: android.googlesource.com: <urlopen error [Errno 104] Connection reset by peer> 。谷歌没有查到相关的资料,烦请各位大虾不吝赐教啊!
root@kuaildg:/home/android# repo sync
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/usr/lib/python2.6/threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/android/.repo/repo/subcmds/sync.py", line 200, in _FetchHelper
clone_bundle=not opt.no_clone_bundle)
File "/home/android/.repo/repo/project.py", line 978, in Sync_NetworkHalf
and self._ApplyCloneBundle(initial=is_new, quiet=quiet):
File "/home/android/.repo/repo/project.py", line 1519, in _ApplyCloneBundle
exist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)
File "/home/android/.repo/repo/project.py", line 1583, in _FetchBundle
raise DownloadError('%s: %s ' % (req.get_host(), str(e)))
DownloadError: android.googlesource.com: <urlopen error [Errno 104] Connection reset by peer>
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/usr/lib/python2.6/threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/android/.repo/repo/subcmds/sync.py", line 200, in _FetchHelper
clone_bundle=not opt.no_clone_bundle)
File "/home/android/.repo/repo/project.py", line 978, in Sync_NetworkHalf
and self._ApplyCloneBundle(initial=is_new, quiet=quiet):
File "/home/android/.repo/repo/project.py", line 1519, in _ApplyCloneBundle
exist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)
File "/home/android/.repo/repo/project.py", line 1583, in _FetchBundle
raise DownloadError('%s: %s ' % (req.get_host(), str(e)))
DownloadError: android.googlesource.com: <urlopen error [Errno 104] Connection reset by peer>
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/usr/lib/python2.6/threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/android/.repo/repo/subcmds/sync.py", line 200, in _FetchHelper
clone_bundle=not opt.no_clone_bundle)
File "/home/android/.repo/repo/project.py", line 978, in Sync_NetworkHalf
and self._ApplyCloneBundle(initial=is_new, quiet=quiet):
File "/home/android/.repo/repo/project.py", line 1519, in _ApplyCloneBundle
exist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)
File "/home/android/.repo/repo/project.py", line 1583, in _FetchBundle
raise DownloadError('%s: %s ' % (req.get_host(), str(e)))
DownloadError: android.googlesource.com: <urlopen error [Errno 104] Connection reset by peer>
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/usr/lib/python2.6/threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/android/.repo/repo/subcmds/sync.py", line 200, in _FetchHelper
clone_bundle=not opt.no_clone_bundle)
File "/home/android/.repo/repo/project.py", line 978, in Sync_NetworkHalf
and self._ApplyCloneBundle(initial=is_new, quiet=quiet):
File "/home/android/.repo/repo/project.py", line 1519, in _ApplyCloneBundle
exist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)
File "/home/android/.repo/repo/project.py", line 1583, in _FetchBundle
raise DownloadError('%s: %s ' % (req.get_host(), str(e)))
DownloadError: android.googlesource.com: <urlopen error [Errno 104] Connection reset by peer>
Exception in thread Thread-5:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/usr/lib/python2.6/threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/android/.repo/repo/subcmds/sync.py", line 200, in _FetchHelper
clone_bundle=not opt.no_clone_bundle)
File "/home/android/.repo/repo/project.py", line 978, in Sync_NetworkHalf
and self._ApplyCloneBundle(initial=is_new, quiet=quiet):
File "/home/android/.repo/repo/project.py", line 1519, in _ApplyCloneBundle
exist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)
File "/home/android/.repo/repo/project.py", line 1583, in _FetchBundle
raise DownloadError('%s: %s ' % (req.get_host(), str(e)))
DownloadError: android.googlesource.com: <urlopen error [Errno 104] Connection reset by peer>
error: Exited sync due to fetch errors
root@kuaildg:/home/android#
[解决办法]
在网上看到说是:把虚拟机的网络连接方式由NAA换成bridge adapter模式。也许有用……
[解决办法]
http://groups.google.com/group/android-building/browse_thread/thread/bb1ef34b52532f57/0c2ac88da487f29d
http://groups.google.com/group/android-building/browse_thread/thread/393e23a6f8bd1d27
[解决办法]
参考官网,
Using authentication
By default, access to the Android source code is anonymous. To protect the servers against excessive usage, each IP address is associated with a quota(原来问题出在这,上次下载源码时IP已经被用了一次,这次在另一个虚拟机中下载就无效了。).
When sharing an IP address with other users (e.g. when accessing the source repositories from beyond a NAT firewall), the quotas can trigger even for regular usage patterns (e.g. if many users sync new clients from the same IP address within a short period).
In that case, it is possible to use authenticated access, which then uses a separate quota for each user, regardless of the IP address.
The first step is to create a password from the password generator and to save it in ~/.netrc according to the instructions on that page.
(在home下新建.netrc文件,然后按网页上的提示写该文件的内容)
The second step is to force authenticated access, by using the following manifest URI: https://android.googlesource.com/a/platform/manifest. Notice how the /a/ directory prefix triggers mandatory authentication. You can convert an existing client to use mandatory authentication with the following command:
$ repo init -u https://android.googlesource.com/a/platform/manifest
[解决办法]
(在home下新建.netrc文件,然后按网页上的提示写该文件的内容)
2. The second step is to force authenticated access, by using the following manifest URI: https://android.googlesource.com/a/platform/manifest. Notice how the /a/ directory prefix triggers mandatory authentication. You can convert an existing client to use mandatory authentication with the following command:
$ repo init -u https://android.googlesource.com/a/platform/manifest -b android-4.0.4_r1.2
3. Then you can pull down souce code in your working directory:
$repo sync