As you may already know, kernel.org site which hosts the Android git repository has been hacked. Because of this we can’t obtain the Android source code from its servers. All attempts to do so ultimately fail with the similar response:
[root@localhost WORKING_DIRECTORY]# repo sync android.git.kernel.org[0: 130.239.17.13]: errno=Connection refused android.git.kernel.org[0: 199.6.1.173]: errno=Connection refused android.git.kernel.org[0: 2001:6b0:e:4017:1972:112:1:0]: errno=Network is unreachable android.git.kernel.org[0: 2001:500:60:10:1972:112:1:0]: errno=Network is unreachable fatal: unable to connect a socket (Network is unreachable) error: Cannot fetch platform/bionic
or:
[root@localhost ~]# curl https://android.git.kernel.org/repo> ~/bin/repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
curl: (7) couldn't connect to hostI will describe another way to get the Android source codes if you hadn’t already cloned it’s repo before kernel.org servers went down.
Prepare the environment
First, you need to download “repo” script from kernel.org my blog (please, enclose the URL address in double quotes):
curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" > ~/bin/repo chmod a+x ~/bin/repo PATH=~/bin:$PATH
Download the Android repository
Now, you can safely download the repository, like so:
mkdir WORKING_DIRECTORY cd WORKING_DIRECTORY repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread repo sync
and start the development…
Please use the Google+ or ‘I like it’ buttons to spread the word about this solution to other Android developers .
Tags: Android
Hello everyone…
I think i am doing this right, but i keep getting this :
$ cd WORKING_DIRECTORY
~/WORKING_DIRECTORY$ repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread
~/bin/repo: line 1: !DOCTYPE: No such file or directory
~/bin/repo: line 2: html: No such file or directory
: command not found: line 3:
~/bin/repo: line 4: head: No such file or directory
~/bin/repo: line 5: meta: No such file or directory
~/bin/repo: line 6: meta: No such file or directory
~/bin/repo: line 7: title: No such file or directory
~/bin/repo: line 7: laquo: command not found
~/bin/repo: line 7: /title: No such file or directory
: command not found: line 8:
~/bin/repo: line 9: link: No such file or directory
~/bin/repo: line 10: link: No such file or directory
: command not found: line 11:
~/bin/repo: line 12: style: No such file or directory
: command not found: line 13:
: command not found: line 15:
~/bin/repo: line 16: /style: No such file or directory
: command not found: line 17:
: command not found: line 18:
: command not found: line 19:
~/bin/repo: line 20: syntax error near unexpected token `newline’
~/bin/repo: line 20: `’
~/WORKING_DIRECTORY$
Any ideas?
-temporizer
Yeah, you probably downloaded a 404 webpage instead of the “repo” script. As I wrote already, the URL to my repo script should be enclosed in the double quotes.
hi all:
I have sync the sourcecode success,but when i make,i got the error on NfcService.java as flow.
packages/apps/Nfc/src/com/android/nfc/NfcService.java:1788: is not abstract and does not override abstract method authenticate(byte[]) in android.nfc.INfcAdapterExtras
private INfcAdapterExtras mExtrasService = new INfcAdapterExtras.Stub() {
^
packages/apps/Nfc/src/com/android/nfc/NfcService.java:1925: method does not override or implement a method from a supertype
@Override
^
packages/apps/Nfc/src/com/android/nfc/NfcService.java:1934: method does not override or implement a method from a supertype
@Override
^
Copying: out/target/common/obj/APPS/EnabledTestApp_intermediates/emma_out/lib/classes-jarjar.jar
Copying: out/target/common/obj/APPS/Film_intermediates/emma_out/lib/classes-jarjar.jar
Copying: out/target/common/obj/APPS/Fountain_intermediates/emma_out/lib/classes-jarjar.jar
Copying: out/target/common/obj/APPS/ImageProcessing_intermediates/emma_out/lib/classes-jarjar.jar
Copying: out/target/common/obj/APPS/SoundPoolTest_intermediates/emma_out/lib/classes-jarjar.jar
Note: packages/apps/Nfc/src/com/android/nfc/RegisteredComponentCache.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
make: *** [out/target/common/obj/APPS/Nfc_intermediates/classes-full-debug.jar] Error 41
make: *** Waiting for unfinished jobs….
Copying: out/target/common/obj/APPS/GL2Java_intermediates/emma_out/lib/classes-jarjar.jar
Thanks for any hint.
Otherwise,I want to use my nfc function in my nexus s,so i can’t rm the /packages/apps/Nfc to jump these errors.Can anybody help me? ^_^
The CodeAurora.org source code is all sorts of messed up. I’ve had various files that have been messed up so far
kzy2@kzy2-virtual-machine:~/bin/myandroid$ repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread
Traceback (most recent call last):
File “/home/kzy2/bin/repo”, line 603, in
main(sys.argv[1:])
File “/home/kzy2/bin/repo”, line 570, in main
_Init(args)
File “/home/kzy2/bin/repo”, line 184, in _Init
_CheckGitVersion()
File “/home/kzy2/bin/repo”, line 213, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File “/usr/lib/python2.6/subprocess.py”, line 623, in __init__
errread, errwrite)
File “/usr/lib/python2.6/subprocess.py”, line 1141, in _execute_child
raise child_exception
OSError: [Errno 20] Not a directory
kzy2@kzy2-virtual-machine:~/bin/myandroid$
hello,it look fail ,what should i do next ? thanks a lot
Hey there,
There is a bug in the source code. Check out the link below:
http://code.google.com/p/android/issues/detail?id=19956
see the repo here https://github.com/android
thank you, this help me a lot.
I have very low speed when downloading, like 30-40 KB/s, usually when I download with, for example, uTorrent I have about 400-500 KB/s
it’s not work!
Getting repo …
from git://codeaurora.org/tools/repo.git
fatal: read error: Connection reset by peer
thankyou very much
@Jayson:
check your firewall settings, maybe your ISP is blocking the 9418 port.
@TheWisp:
unfortunately, codeaurora site is not mirrored worldwide, because of that some people find it harder to achieve higher downloading speeds than other (it depends on your location, and your ISP)
hi, repo init worked perfectly but after that i tried to run repo sync and its trying to reach the old android.git.kernel site.
anybody got a solution?
Looking for android-2.3.5_r1. Not found yet…
@neil:
It looks like android-2.3.5_r1 is not available in codeaurora repo. You can however try to use the “gingerbread” branch, it is currently in a 2.3.5 version (but may be less stable than r1).
Thanks, Artur. I could “repo sync”, but the attempt to build for generic emulator gives errors:
host Executable: yuv420sp2rgb (out/host/darwin-x86/obj/EXECUTABLES/yuv420sp2rgb_intermediates/yuv420sp2rgb)
Undefined symbols for architecture i386:
“_sqlite3_androidopt_open”, referenced from:
_openDatabase in sqlite3.o
_openDatabase in sqlite3.o
“_sqlite3_androidopt_handle_pragma”, referenced from:
_sqlite3Pragma in sqlite3.o
_sqlite3Pragma in sqlite3.o
ld: symbol(s) not found for architecture i386
Probably you know, why?
Regards
Other attempt, other errors:
ld: warning: -read_only_relocs cannot be used with x86_64
Undefined symbols for architecture x86_64:
“___bzero”, referenced from:
_parse_expr in csparse.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [out/host/darwin-x86/obj/lib/libneo_cs.dylib] Error 1
Hmmm….
@ avihai
the line
repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread
should be
repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread --repo-url=git://codeaurora.org/tools/repo.gitI have tried it several times now: init, sync OK. Build – fail… It doesn’t compile w/o errors on a Mac.
Thank you very much!
from git://codeaurora.org/tools/repo.git
codeaurora.org[0: 199.106.109.189]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)
does you change your link address? thank you very much
@ethan
Please, check your firewall settings.
Thanks for your post, Why am I not able to see Hindi language supported in Gingerbread..Google official announcement claims Hindi (hi_In) is supported 2.3.x onward..
Thanking once again and hoping to get some input by which I can lay hands on the Hindi language support.
Your checksum does not match what it should be according to Google.
The MD5 checksum for repo is bbf05a064c4d184550d71595a662e098 (Google)
Your md5 checksum is not this.
@android:
as I wrote before in older comments I changed the “repo” script (the fifth code line) so it points to codeaurora site, rather than android.git.kernel.org server.
You can change the URL to kernel.org and make a md5 checksum to confirm this if you want to be sure.
That makes sense thanks
I am having an error after successfully downloading a great number of objects.
When I do “repo init -u git://codeaurora.org/platform/manifest.git -b eclair”
I get this below:
Traceback (most recent call last):
File “/Users/arduino/Desktop/android_source/.repo/repo/main.py”, line 238, in
_Main(sys.argv[1:])
File “/Users/arduino/Desktop/android_source/.repo/repo/main.py”, line 220, in _Main
repo._Run(argv)
File “/Users/arduino/Desktop/android_source/.repo/repo/main.py”, line 125, in _Run
cmd.Execute(copts, cargs)
File “/Users/arduino/Desktop/android_source/.repo/repo/subcmds/init.py”, line 260, in Execute
self._LinkManifest(opt.manifest_name)
File “/Users/arduino/Desktop/android_source/.repo/repo/subcmds/init.py”, line 166, in _LinkManifest
self.manifest.Link(name)
File “/Users/arduino/Desktop/android_source/.repo/repo/manifest_xml.py”, line 86, in Link
self.Override(name)
File “/Users/arduino/Desktop/android_source/.repo/repo/manifest_xml.py”, line 79, in Override
self._Load()
File “/Users/arduino/Desktop/android_source/.repo/repo/manifest_xml.py”, line 236, in _Load
self._ParseManifest(True)
File “/Users/arduino/Desktop/android_source/.repo/repo/manifest_xml.py”, line 254, in _ParseManifest
root = xml.dom.minidom.parse(self.manifestFile)
File “/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/dom/minidom.py”, line 1918, in parse
return expatbuilder.parse(file)
File “/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/dom/expatbuilder.py”, line 924, in parse
result = builder.parseFile(fp)
File “/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/dom/expatbuilder.py”, line 207, in parseFile
parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: mismatched tag: line 11, column 4
Hi!
I tried to compile Android kernel. There are a lot of errors in below log. I don’t know the cause of it.
maxim@maxim:~/WORKING_DIRECTORY$ . build/envsetup.sh
including device/htc/passion/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
maxim@maxim:~/WORKING_DIRECTORY$ lunch full-eng
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.5
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GRJ90
============================================
maxim@maxim:~/WORKING_DIRECTORY$ make
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.5
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GRJ90
============================================
build/core/base_rules.mk:105: *** Module name: core contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: core-junit contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: sqlite-jdbc contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: core-hostdex contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: libjavacore contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: libjavacore-host contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: libsqlite_jni contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: libsqlite_jni contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: Camera contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: sensors.mahimahi contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: lights.mahimahi contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: libnfc contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: libnfc_ndef contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: HTMLViewer contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: Fallback contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: CalendarProvider contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: bouncycastle contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: bouncycastle-hostdex contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: ddmlib-prebuilt contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: tools-common-prebuilt contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: layoutlib_api-prebuilt contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: ninepatch-prebuilt contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: tradefed-prebuilt contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: Gallery contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: Launcher2 contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:146: user tag on app Stk at packages/apps/Stk – add your app to core.mk instead
build/core/base_rules.mk:105: *** Module name: librecovery_updater_htc contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: libcrypto contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: libcrypto contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: libcrypto_static contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: libssl contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: libssl contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: ssltest contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: CertInstaller contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: Gallery3D contains invalid LOCAL_MODULE_TAGS
external/bionic/libc/Android.mk:566: warning: overriding commands for target `out/target/product/generic/obj/lib/crtbegin_so.o’
bionic/libc/Android.mk:566: warning: ignoring old commands for target `out/target/product/generic/obj/lib/crtbegin_so.o’
external/bionic/libc/Android.mk:572: warning: overriding commands for target `out/target/product/generic/obj/lib/crtend_so.o’
bionic/libc/Android.mk:572: warning: ignoring old commands for target `out/target/product/generic/obj/lib/crtend_so.o’
external/bionic/libc/Android.mk:580: warning: overriding commands for target `out/target/product/generic/obj/lib/crtbegin_static.o’
bionic/libc/Android.mk:580: warning: ignoring old commands for target `out/target/product/generic/obj/lib/crtbegin_static.o’
external/bionic/libc/Android.mk:586: warning: overriding commands for target `out/target/product/generic/obj/lib/crtbegin_dynamic.o’
bionic/libc/Android.mk:586: warning: ignoring old commands for target `out/target/product/generic/obj/lib/crtbegin_dynamic.o’
external/bionic/libc/Android.mk:595: warning: overriding commands for target `out/target/product/generic/obj/lib/crtend_android.o’
bionic/libc/Android.mk:595: warning: ignoring old commands for target `out/target/product/generic/obj/lib/crtend_android.o’
build/core/base_rules.mk:166: *** external/bionic/libc: MODULE.TARGET.STATIC_LIBRARIES.libc_common already defined by bionic/libc. Stop.
I tried to change ifneq ($(filter $(LOCAL_MODULE_TAGS), optional),) to
ifneq ($(filter $(LOCAL_MODULE_TAGS), user),) and had other errors.
build/core/base_rules.mk:105: *** Module name: hostapd contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: hostapd_cli contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: nt_password_hash contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: hlr_auc_gw contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:105: *** Module name: Stk contains invalid LOCAL_MODULE_TAGS
build/core/base_rules.mk:146: user tag on app Stk at packages/apps/Stk – add your app to core.mk instead
build/core/base_rules.mk:105: *** Module name: ip contains invalid LOCAL_MODULE_TAGS
external/bionic/libc/Android.mk:566: warning: overriding commands for target `out/target/product/generic/obj/lib/crtbegin_so.o’
bionic/libc/Android.mk:566: warning: ignoring old commands for target `out/target/product/generic/obj/lib/crtbegin_so.o’
external/bionic/libc/Android.mk:572: warning: overriding commands for target `out/target/product/generic/obj/lib/crtend_so.o’
bionic/libc/Android.mk:572: warning: ignoring old commands for target `out/target/product/generic/obj/lib/crtend_so.o’
external/bionic/libc/Android.mk:580: warning: overriding commands for target `out/target/product/generic/obj/lib/crtbegin_static.o’
bionic/libc/Android.mk:580: warning: ignoring old commands for target `out/target/product/generic/obj/lib/crtbegin_static.o’
external/bionic/libc/Android.mk:586: warning: overriding commands for target `out/target/product/generic/obj/lib/crtbegin_dynamic.o’
bionic/libc/Android.mk:586: warning: ignoring old commands for target `out/target/product/generic/obj/lib/crtbegin_dynamic.o’
external/bionic/libc/Android.mk:595: warning: overriding commands for target `out/target/product/generic/obj/lib/crtend_android.o’
bionic/libc/Android.mk:595: warning: ignoring old commands for target `out/target/product/generic/obj/lib/crtend_android.o’
build/core/base_rules.mk:166: *** external/bionic/libc: MODULE.TARGET.STATIC_LIBRARIES.libc_common already defined by bionic/libc. Stop.
maxim@maxim:~/WORKING_DIRECTORY$
Any ideas?
I was wondering why the checksum of your repo is different from the one on “https://github.com/android/tools_repo”. You better don’t mess with this stuff.
The correct checksum is “bbf05a064c4d184550d71595a662e098″ from “http://source.android.com/source/downloading.html”
@MeisterLi:
Everything is OK. I changed the URL in a repo script, so it points to the codeaurora site.
See this link for futher info.
[...] team has not logged back in to reactivate the project. I found this as an alternative source Kernel.org hacked – how to get Android repo? mindexception: out of context This gets the kernel source and development environment for Gingerbread, but simply replacing the [...]
repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread
Traceback (most recent call last):
File “/home/kasi/bin/repo”, line 603, in
main(sys.argv[1:])
File “/home/kasi/bin/repo”, line 570, in main
_Init(args)
File “/home/kasi/bin/repo”, line 184, in _Init
_CheckGitVersion()
File “/home/kasi/bin/repo”, line 213, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File “/usr/lib/python2.6/subprocess.py”, line 623, in __init__
errread, errwrite)
File “/usr/lib/python2.6/subprocess.py”, line 1141, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
The above error is showing… can anyone help me on this error???
@ Kasi and kzy
Do you have git installed? To proof this type “git” in the command line.
HI,
Can any one help to get the “source code for Android-X86…”
1. is it possible as of now….
2 . Am trying from few days but its getting some errors like
“Fetching projects: 1% (2/171) android.git.kernel.org[0: 149.20.4.77]: errno=Connection refused”
Thank you in Advance…..
.
Hi,
I run repo sync, but it’s freezes in receiving objects (x/..).
I tried a few times and wait long, but every time it’s stuck a different place.
What could be the reason?
Thanks in Advance
Hi,
I could managed to work with repo after downloading repo.Just follw below:
wget http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo
chmod a+x repo
./repo init -u git://git.omapzoom.org/platform/omapmanifest.git -b 27.x -m RLS27.12.1-P2_Gingerbread.xml
./repo sync
But sudo apt-get install ia32-libs will not work.I tried different way to rectify this.
Br,
Suomi
Suomi, what OS are you using?
Please, give me more details about the ia32-lib problem, what error do you have after executing apt?
Niezly post. Tak trzymac. Na pewno bede zagladal:)
Hello all,
Please I need a help. I am trying to download android source code by following the instructions mentioned above. Everything going fine, but I couldn’t able to finish downloading. because it freezes(stop for long time) after some steps. So I am forced to restart it again. Please help me if you guys have encountered this problem.
Thanks in advance!