Can't repo init android source code mirror - android

I'm trying to mirror Android source code but it's not possible.
I had to upgrade python to 3.6 and update repo.
However I can't repo init android source mirror.
jeffrey#devserver:/home1/aosp/mirror$ repo init -u
https://android.googlesource.com/mirror/manifest --mirror Downloading
Repo source from https://gerrit.googlesource.com/git-repo Downloading
manifest from https://android.googlesource.com/mirror/manifest
Traceback (most recent call last): File
"/home1/aosp/mirror/.repo/repo/main.py", line 627, in
_Main(sys.argv[1:]) File "/home1/aosp/mirror/.repo/repo/main.py", line 601, in _Main
result = run() File "/home1/aosp/mirror/.repo/repo/main.py", line 594, in
run = lambda: repo._Run(name, gopts, argv) or 0 File "/home1/aosp/mirror/.repo/repo/main.py", line 260, in _Run
result = cmd.Execute(copts, cargs) File "/home1/aosp/mirror/.repo/repo/subcmds/init.py", line 519, in Execute
self._SyncManifest(opt) File "/home1/aosp/mirror/.repo/repo/subcmds/init.py", line 220, in
_SyncManifest
default_branch = m.ResolveRemoteHead() File "/home1/aosp/mirror/.repo/repo/project.py", line 1914, in
ResolveRemoteHead
output = self.bare_git.ls_remote('-q', '--symref', '--exit-code', name, 'HEAD') File "/home1/aosp/mirror/.repo/repo/project.py", line
3034, in runner
(self._project.name, name, p.stderr)) error.GitError: manifests ls-remote: usage: git ls-remote [--heads] [--tags]
[--upload-pack=]
[-q | --quiet] [--exit-code] [--get-url] [ [...]]
Can anyone help on this?
Thanks,

Your 'git ls-remote' does not have '--symref' parameter, maybe you need to update the git version.

Related

AOSP repo sync fails on macOS Catalina

I keep having the same error while trying to do checkout AOSP source on macOS Catalina 10.15.7. Followed all the instructions on https://source.android.com/setup/build/initializing#setting-up-a-mac-os-x-build-environment, also https://source.android.com/setup/build/downloading and tried different tags. This is what happens after I invoke repo --trace sync -j1.
: git config --file /Volumes/android/aosp/.repo/projects/external/skqp.git/config --includes --null --list 1>| 2>|
: export GIT_DIR=/Volumes/android/aosp/.repo/projects/external/skqp.git
: git rev-parse --verify refs/tags/android-10.0.0_r41^0 1>| 2>|
: cd /Volumes/android/aosp/external/skqp
: git read-tree --reset -u -v HEAD 1>| 2>|
error: RPC failed; HTTP 499 curl 16 Error in the HTTP2 framing layer
fatal: the remote end hung up unexpectedly
error: Cannot checkout platform/external/skqp: GitError: Cannot initialize work tree for platform/external/skqp
: git rev-list refs/tags/android-10.0.0_r41 -1 1>| 2>|
Traceback (most recent call last):
File "/Volumes/android/aosp/.repo/repo/main.py", line 630, in <module>
_Main(sys.argv[1:])
File "/Volumes/android/aosp/.repo/repo/main.py", line 604, in _Main
result = run()
File "/Volumes/android/aosp/.repo/repo/main.py", line 597, in <lambda>
run = lambda: repo._Run(name, gopts, argv) or 0
File "/Volumes/android/aosp/.repo/repo/main.py", line 266, in _Run
result = cmd.Execute(copts, cargs)
File "/Volumes/android/aosp/.repo/repo/subcmds/sync.py", line 983, in Execute
self._Checkout(all_projects, opt, err_event, err_results)
File "/Volumes/android/aosp/.repo/repo/subcmds/sync.py", line 567, in _Checkout
self._CheckoutWorker(**kwargs)
File "/Volumes/android/aosp/.repo/repo/subcmds/sync.py", line 447, in _CheckoutWorker
return self._CheckoutOne(opt, project, *args, **kwargs)
File "/Volumes/android/aosp/.repo/repo/subcmds/sync.py", line 481, in _CheckoutOne
project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
File "/Volumes/android/aosp/.repo/repo/project.py", line 1223, in Sync_LocalHalf
self._InitWorkTree(force_sync=force_sync, submodules=submodules)
File "/Volumes/android/aosp/.repo/repo/project.py", line 2758, in _InitWorkTree
raise GitError('Cannot initialize work tree for ' + self.name)
error.GitError: Cannot initialize work tree for platform/external/skqp

Using repo in Cygwin to download Android source

Following the instructions on http://source.android.com/source/downloading.html and https://honey200.wordpress.com/2011/11/17/download-android-source-code-in-windows/ I can't initialize a repo when running under Cygwin on Windows. I've done this before on Linux and everything has worked.
In the cygin terminal I've got git and curl installed, but when I run:
repo init -u https://android.googlesource.com/platform/manifest -b android-5.0.0_r7
I get the following:
Get https://android.googlesource.com/platform/manifest
Traceback (most recent call last):
File "/cygdrive/e/lollipop/source/.repo/repo/main.py", line 531, in <module>
_Main(sys.argv[1:])
File "/cygdrive/e/lollipop/source/.repo/repo/main.py", line 507, in _Main
result = repo._Run(argv) or 0
File "/cygdrive/e/lollipop/source/.repo/repo/main.py", line 180, in _Run
result = cmd.Execute(copts, cargs)
File "/cygdrive/e/lollipop/source/.repo/repo/subcmds/init.py", line 390, in Execute
self._SyncManifest(opt)
File "/cygdrive/e/lollipop/source/.repo/repo/subcmds/init.py", line 163, in _SyncManifest
m._InitGitDir(mirror_git=mirrored_manifest_git)
File "/cygdrive/e/lollipop/source/.repo/repo/project.py", line 2148, in _InitGitDir
self.bare_objdir.init()
File "/cygdrive/e/lollipop/source/.repo/repo/project.py", line 2644, in runner
p.stderr))
error.GitError: manifests init: fatal: Could not switch to '/cygdrive/e/lollipop/source/.repo/': No such file or directory
What am I missing?

Move Android Sources to another Machine

So, Basically I've synced all the Cm-11.0 sources to my PC. Now I had move the sources to another PC. So i thought that copying just '.repo' folder and running repo sync -l to another PC will do the trick.
Now I have .repo folder and when I run repo sync it gives the following error
dkbhadeshiya#CrayJaguar:~/android/cm11$ repo sync -j1
Fetching project CyanogenMod/android_frameworks_webview
Traceback (most recent call last):
File "/home/dkbhadeshiya/android/cm11/.repo/repo/main.py", line 500, in <module>
_Main(sys.argv[1:])
File "/home/dkbhadeshiya/android/cm11/.repo/repo/main.py", line 476, in _Main
result = repo._Run(argv) or 0
File "/home/dkbhadeshiya/android/cm11/.repo/repo/main.py", line 155, in _Run
result = cmd.Execute(copts, cargs)
File "/home/dkbhadeshiya/android/cm11/.repo/repo/subcmds/sync.py", line 635, in Execute
fetched = self._Fetch(to_fetch, opt)
File "/home/dkbhadeshiya/android/cm11/.repo/repo/subcmds/sync.py", line 339, in _Fetch
self._FetchProjectList(**kwargs)
File "/home/dkbhadeshiya/android/cm11/.repo/repo/subcmds/sync.py", line 234, in _FetchProjectList
success = self._FetchHelper(opt, project, *args, **kwargs)
File "/home/dkbhadeshiya/android/cm11/.repo/repo/subcmds/sync.py", line 275, in _FetchHelper
no_tags=opt.no_tags, archive=self.manifest.IsArchive)
File "/home/dkbhadeshiya/android/cm11/.repo/repo/project.py", line 1076, in Sync_NetworkHalf
self._UpdateHooks()
File "/home/dkbhadeshiya/android/cm11/.repo/repo/project.py", line 2098, in _UpdateHooks
self._InitHooks()
File "/home/dkbhadeshiya/android/cm11/.repo/repo/project.py", line 2126, in _InitHooks
os.symlink(os.path.relpath(stock_hook, os.path.dirname(dst)), dst)
OSError: [Errno 20] Not a directory
and when I run Repo Sync -l It gives following error:
dkbhadeshiya#CrayJaguar:~/android/cm11$ repo sync -l
error: in `sync -l`: revision refs/heads/cm-11.0 in CyanogenMod/android_abi_cpp not found
Any Idea how to solve this??
Maybe you can try this command before you sync.
repo forall -vc "git reset --hard"

Compiling CyanogenMod for lg g2 d802

I'm trying to build CyanogenMod for intl G2 (the only change I've made is to add halo)
for the repo init I've done:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0 -g all,-notdefault,d802,lge
And then repo sync -j8
After that, like I've said, I've added halo.
And now I'm trying to build by doing:
$ source build/envsetup.sh
$ breakfast d802
but the only things I get is:
root#synnyg-PC:~/CM/G2# breakfast d802
including vendor/cm/vendorsetup.sh
build/core/product_config.mk:238: *** _nic.PRODUCTS.[[device/lge/d802/cm.mk]]: "device/lge/g2-common/g2.mk" does not exist. ArrĂȘt.
Device d802 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Traceback (most recent call last):
File "build/tools/roomservice.py", line 76, in <module>
result = json.loads(urllib.request.urlopen(githubreq).read().decode())
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 448, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
build/core/product_config.mk:238: *** _nic.PRODUCTS.[[device/lge/d802/cm.mk]]: "device/lge/g2-common/g2.mk" does not exist. ArrĂȘt.
** Don't have a product spec for: 'cm_d802'
** Do you have the right repo manifest?
I don't understand because when I take a look to device, there is no lge/d802 directory. By doing the init command, I would have to download specific files...
also lunch and breakfast command gave me the same error...
Do you have an idea where I'm wrong and what can I do ? I think I've to download the device specific files but how can I do this (if this is the error) ? I don't see...
Thanks in advance !

Android Source: Repo not displaying any initialization message

I've followed the instructions Google has provided on downloading the Source Tree, but after I run the command
$ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
and I receive the following error message :
$ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
Traceback (most recent call last):
File "/Users/roboguy12/bin/repo", line 690, in <module>
main(sys.argv[1:])
File "/Users/roboguy12/bin/repo", line 657, in main_Init(args)
File "/Users/roboguy12/bin/repo", line 189, in _Init_CheckGitVersion()
File "/Users/roboguy12/bin/repo", line 214, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
What did I do wrong? Or is this just an error on behalf of Repo?
UPDATE: Now that I've installed Python 2.7, I still have almost the exact same error message:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
Traceback (most recent call last):
File "/Users/roboguy12/bin/repo", line 690, in <module>
main(sys.argv[1:])
File "/Users/roboguy12/bin/repo", line 657, in main_Init(args)
File "/Users/roboguy12/bin/repo", line 189, in _Init_CheckGitVersion()
File "/Users/roboguy12/bin/repo", line 214, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
I call $ python -V and it says Python 2.7.1, so I don't know what else I can do.
Seems to me you might have not done a couple of things: chmod'd the repo to +x and/or put it in your $PATH statement as the first directory to look for (and could be using another version of repo). Have you tried 'ls -al' instead? The directory you're looking for is hidden and you need the -a argument in ls to view hidden files/directories.
UPDATE: Ah, just saw your update. Since you're using a Mac, you need to use Python 2.7. To do so, you'll need to MacPort it. This website provided much help to me: INSTALLING PYTHON 2.7, EASY_INSTALL, PIP, VIRTUALENV AND VIRTUALENVWRAPPER ON MAC OS X

Categories

Resources