Android編譯筆記

curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
curl: (7) Failed to connect to 2404:6800:4005:c00::5d: Network is unreachable
替換成如下的命令即可:
curl http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo > ~/bin/repo
繼續執行以下命令:
repo init -u https://android.googlesource.com/platform/manifest
repo sync
會報以下的錯誤:
fatal: '../platform/abi/cpp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
error: Cannot fetch platform/abi/cpp
在.repo目錄下的manifest.xml裏找到fetch屬性,改成:
fetch= "https://android.googlesource.com/"
然後,再執行repo sync命令!還會報錯:
error: The requested URL returned error: 406 while accessing https://android.googlesource.com/platform/manifest/info/refs
fatal: HTTP request failed
解決方法:
1. 瀏覽器登錄https://android.googlesource.com/new-password,並用gmail帳號登錄;
2. 點擊網頁上的“允許訪問”,得到類似:

Staying Authenticated - Linux and Mac OS X:
machine android.googlesource.com login git-happyitdad.gmail.com password 1/p9nZQ-WpdDlUFzLSGZvDXkOgqo2IV5YQkci2adcnJs4
machine android-review.googlesource.com login git-happyitdad.gmail.com password 1/p9nZQ-WpdDlUFzLSGZvDXkOgqo2IV5YQkci2adcnJs4

3. 把上面那段machine信息追加到~/.netrc文件結尾(請檢查當前用戶的權限, 如果不存在此文件則自己新建一個);
4. 下載地址的URI更改爲https://android.googlesource.com/a/platform/manifest(中間加上了“/a”)。
5. repo init -u https://android.googlesource.com/a/platform/manifest
6. repo sync
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章