Solve problems encountered when downloading Android source code

Source: Internet
Author: User

This article solves the problem of downloading Android source code from machines with public IP addresses (limited Internet IP addresses, which often occur in the company's network environment or virtual machines.
Note: This article only addresses the problems encountered when downloading the source code from android.googlesource.com. due to factors such as network and subsequent Android source code maintenance and upgrade, it is time-sensitive and cannot guarantee that it will take effect in the future.

During the May Day holiday, you need to download all android 4.0 and Android from your home network. However, the operation has encountered problems.
Android code was previously managed in Linux kernel (android.git.kernel.org). After being kicked out by Kernel, Android source code is now directly managed by Google (android.googlesource.com.
Run
[Plain]
1. $ repo init-u https://android.googlesource.com/platform/manifest-B android-4.0.4_r1.2
Error:
[Plain]
1. Exception in thread Thread-3:
2. Traceback (most recent call last ):
3. File "/usr/lib/python2.6/threading. py", line 532, in _ bootstrap_inner
4. self. run ()
5. File "/usr/lib/python2.6/threading. py", line 484, in run
6. self. _ target (* self. _ args, ** self. _ kwargs)
7. File "/home/haili/android-4.0.4_r1.2/. repo/subcmds/sync. py", line 200, in _ FetchHelper
8. clone_bundle = not opt. no_clone_bundle)
9. File "/home/haili/android-4.0.4_r1.2/. repo/project. py", line 978, in Sync_NetworkHalf
10. and self. _ ApplyCloneBundle (initial = is_new, quiet = quiet ):
11. File "/home/haili/android-4.0.4_r1.2/. repo/project. py", line 1519, in _ ApplyCloneBundle
12. exist_dst = self. _ FetchBundle (bundle_url, bundle_tmp, bundle_dst, quiet)
13. File "/home/haili/android-4.0.4_r1.2/. repo/project. py", line 1583, in _ FetchBundle
14. raise DownloadError ('% s: % s' % (req. get_host (), str (e )))
15. DownloadError: android.googlesource.com: <urlopen error [Errno 110] Connection timed out>
16 ....
 

This error is inexplicable. Python is correctly installed and the version is required. In fact, the official website (http://source.android.com/source/downloading.html) has a paragraph description, if seriously executed can solve.
1. log on to https://android.googlesource.com/new-passwordin the browser and use the gmailaccount number to renew it;
2. Click "Allow access" on the webpage to obtain the following information:
[Plain]
1. machine android.googlesource.com login git-<userName> .gmail.com password <password>
2. machine android-review.googlesource.com login git-<userName> .gmail.com password <password>
 
.
3. append the above information (<userName> and <password> with your own real information) ~ /. The End Of The netrc file;
4. The URI is changed to the https://android.googlesource.com/a/platform/manifest ('/A' is added in the middle ").
Then follow the normal steps described on the official website to pull down the Android source code.

The official statement is: Because access is basically anonymous, in order to prevent too many connections, the number of connections to the same IP address is limited. It seems to be using a gmail account for authentication.
In this case, you will often encounter this problem when downloading from the company network or using virtual machines.

 

From Tian haili @ CSDN

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.