下載被限制
解決方案
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.
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 with the password generator and follow the instructions on the password generator page.
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
簡單來說就是
1. 打開網址 https://android.googlesource.com/new-password,按照網頁提示生成命令行,然後在下載源碼的機器上執行 - 自然,前提是要先用賬戶登錄
2. 重新輸入原來的命令,不過在 platform 前面加上 a, 例如
$ repo init -u https://android.googlesource.com/a/platform/manifest
3. 輸入上名命令後會有提示,根據提示或者輸入正確的用戶郵箱或者修改
參考
https://source.android.com/source/downloading.html#using-authentication
切換分之後下載失敗
錯誤症狀
error: Exited sync due to fetch errors
解決方案
$ repo sync
$ repo sync -f
參考