首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > 驱动开发 >

android源码下载报错解决办法

2013-03-27 
android源码下载报错各位大虾:小弟刚刚准备下载android源码,重新下载几次都没有解决问题,还是报的如下错误

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
[解决办法]

引用:
大哥,能不能把那个内容贴出来啊,谷歌的内容经常打不开啊!
引用:
http://groups.google.com/group/android-building/browse_thread/thread/bb1ef34b52532f57/0c2ac88da487f29d

http://groups.google.com/group/android-building/b……

I solved that setting HTTPS_PROXY and HTTP_PROXY variables in 
my shell before doing "repo init" and "repo sync". Something like: 
export 
HTTP_PROXY=http://<proxy_account_name>:<proxy_password>@<proxy_server>:8080 
export 
HTTPS_PROXY=http://<proxy_account_name>:<proxy_password>@<proxy_server>:808 0 
--------------------------
This might be caused by having nested repos. repo (the tool) doesn't 
really like that, so it gets confused, and outputs confusing error 
messages. 
[解决办法]
5楼的回答是正确的:

1. 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文件,然后按网页上的提示写该文件的内容)

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

热点排行