Android Repository Remedy (FIXED AND WORKING)

If you all haven’t noticed, kernel.org suffered an attack and as such, all of its servers have been taken down and are in the process of coming back online. For Cyanogenmod developers, this means that the AOSP repository (android.git.kernel.org) is unavailable, which causes many problems for syncing and initializing the repository on our machines. Luckily, Steve Kondik has come to the rescue and pushed the AOSP projects to github.com/CyanogenMod.

STATUS: Steve Kondik, the lead designer of CyanogenMod has pushed all of the AOSP projects to github.com/CyanogenMod and has updated the manifests to reflect this change. So getting it working is easy now. Everything is tested and works perfectly again. Say thanks to Steve!

So here’s the deal! You right now can be one of three people:

1. Your code builds fine and it’s the same code from before kernel.org went offline. (This used to be a valid issue but with Steve’s work you should be syncing fine now. If you’re still having problems, follow the guide for person 2).

2. You previously have been to my blog and tried version 1 of my fix, but no matter what, it will not build or sync!

3. You’re pulling the source code for the first time or you’re initializing the source code on a new machine.

Decide who you are and scroll down to the appropriate section.


Person 1 -

You used to have problems, but with Steve’s fixes pushed to CyanogenMod’s source, you should be having no issues. If you’re still having sync problems, continue on to “Person 2″.


Person 2 -

You previously have been to my blog and tried version 1 and 2 of my fix, but no matter what, it will not build or sync!

Well first, thank you if you’ve commented about any problems you’ve had. You might not know it, but your complaints helped me find the solution to your problems, so thank you indeed! Anyways, here’s your solution:

First, remove the git config edit from the first version of my solution:

git config --global --unset url.git://codeaurora.org.insteadof

Then follow these steps to reconfigure your manifest to use CyanogenMod’s manifest again.

cd ~/android/system/.repo
rm -rf manifests*
rm -rf repo
cd ~/android/system
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread --repo-url=git://github.com/android/tools_repo.git
repo sync -j16

If you still have problems, “rm -rf ~/android” and continue on to “Person 3″.


Person 3 -

How exciting! You’re building the source code for the first time or you’re initializing the source code on a new machine!

Follow the proper guide for building source code for your device located HERE. If your device does not have a guide up, follow the directions under the section “Prepare the Build Environment” located in the Android SDK Emulator building instructions, located HERE. The steps for setting up your build environment are the same for every device.

When the guide asks you to run the following line of code in your terminal:

curl http://android.git.kernel.org/repo > ~/bin/repo

INSTEAD run this line:

curl https://raw.github.com/android/tools_repo/master/repo > ~/bin/repo

And when the guide asks you to run the following line of code in your terminal:

repo init -u git://github.com/CyanogenMod/android.git -b gingerbread

INSTEAD run this line:

repo init -u git://github.com/CyanogenMod/android.git -b gingerbread --repo-url=git://github.com/android/tools_repo.git

And then follow the rest of the guide, and you will have your code all good to go!


When the korg servers come back online, you won’t have to do anything! Just keep syncing like normal!

Thanks: After spending countless hours debugging my previous method of pulling the source from Code Aurora, I found that it was hit-or-miss with users. For some, my method worked fine, but for others, the code would fail to sync. I was one of those whose code was working fine, so debugging the issue was difficult alone. Thanks goes to Midnight Programmer for being my testing guinea pig and helping find the solution to his problems.

22 thoughts on “Android Repository Remedy (FIXED AND WORKING)

  1. MrCalculator says:

    This article is a extraordinarily good sole. Thank for partitioning such great facts out. Ill deff be stoping by more times then i do so i an notice whats amazing!

  2. Michael says:

    Hello, I was wondering if anyone has had these errors, and figured out a solution?

    http://pastebin.com/1EUKKRMg

  3. emoboiix3 says:

    Uhh, I am having problems trying to sync.
    I keep geting errors that it’s not able to look up certain folders and it exits due to sync errors.

    • synrgi says:

      Hi emoboiix3,

      Could you provide a paste of the error generated? Either copy/paste here if it’s short, or use pastebin.com

      It’s much easier for me to troubleshoot with the actual error statement

      • emoboiix3 says:

        Fetching projects: 32% (96/300) fatal: Unable to look up github.com (port 9418) (Name or service not known)
        error: Cannot fetch CyanogenMod/android_device_semc_shakira
        root@lol-VirtualBox-AOSP:~/android/system# repo sync
        Fetching projects: 32% (96/299) fatal: Unable to look up github.com (port 9418) (Name or service not known)
        error: Cannot fetch CyanogenMod/android_device_semc_urushi
        :/ Thanks for helping

        • emoboiix3 says:

          Never mind, I’ve fixed the problems.
          But how do I make the AOSP for a ARMv6 device?
          cyanogenmod_generic-eng and full-eng in lunch both has ARMv7 as their Target Arch Variant.

        • synrgi says:

          Which device in particular?
          If you type in lunch without any argument, it will give you a list of all the possible builds of cyanogen. If your device is on that list, you can build for it. If you’re trying to port cm to a different device, then I’m not entirely positive on how to help you.

  4. Anonymous says:

    In case you haven’t received enough love on this one….

    I’m taking a shot at doing the Touchpad install. I’m just anxious since I have 3 of them here, and have learned to hate WebOS (I have an Android phone stock-ish, and a B&N Nook with CM7 on it). I’ve worked on every platform BUT Android, so why not. So I’m in the “Person 3″ category, so I needed everything. Lets see how this goes, or if I can make 3 bricked Touchpads. :)

    • synrgi says:

      I wish you the best of luck!
      I’ve found that it’s very hard to permanently brick android-based devices, as long as you read CM’s directions you should have no issues.

  5. Midnight Programmer says:

    I dont know why… but it cannt find BRUNCH ???? Did I miss something ???

    Thankw

  6. loli are moe says:

    thx for this tuto, works like a charm

  7. Marc Grondin says:

    thank you for all your efforts. all checks our alright but i still cannot build for my device. it ends with

    system/media/opensles/libopensles/android_SfPlayer.cpp: In member function ‘void android::SfPlayer::onPrepare(const android::sp&)’:
    system/media/opensles/libopensles/android_SfPlayer.cpp:273: error: no matching function for call to ‘android::DataSource::getSize(off64_t*)’
    frameworks/base/include/media/stagefright/DataSource.h:56: note: candidates are: virtual android::status_t android::DataSource::getSize(off_t*)
    system/media/opensles/libopensles/android_SfPlayer.cpp: In member function ‘void android::SfPlayer::onDecode()’:
    system/media/opensles/libopensles/android_SfPlayer.cpp:659: warning: comparison between signed and unsigned integer expressions
    make: *** [out/target/product/galaxysmtd/obj/SHARED_LIBRARIES/libOpenSLES_intermediates/android_SfPlayer.o] Error 1
    make: *** Waiting for unfinished jobs….

    not sure if it because of this git server thing or if it’s cm7 source prob…will keeo investigating more tomorrow

    • synrgi says:

      I’m getting that error too. I’m currently looking into finding someone with an intact copy of the AOSP code from before the server went down. If I can pull the code from him/her, I’ll update this post and that should completely fix the build problems. I was hoping korg would be up by now… The error is due to a difference in the Code Aurora git repos, they’re not completely the same as the korg repos.

  8. synrgi says:

    Cleaned up the previous comments as to not confuse and newcomers to the blog with my efforts of getting the source to sync

  9. reppard says:

    Hello and you thank you for this valuable post. I have a small problem I’d like to see if you could help me with. I am trying to sync up with a forked repo forked from cm7. git://github.com/inferiorhumanorgans/android.git. I get the webp error and follow the directions. Sync up with -f and it completes (with the warning about webp) yet when I look in my build directory everything isn’t pulled. No vendor folder or prebuilt folder along with a few others missing. If I look in .repo/projects I see folders for all of these yet they do not pull to the build folder. Any help would be greatly appreciated!
    Reppard

    • synrgi says:

      With the way the Code Aurora repos are setup, I’ve changed my method of getting the source from them. I can apply my edits to his android.git if you’d like, but based on my experiences, I personally would not recommend trying to build this source for a phone. It’s becoming increasingly difficult to get to even build for some targets. Still, if you would like to try, let me know

      • reppard says:

        I’ve got the repo forked here git://github.com/reppard/android.git. I’ll give it a try =). I keep running in to module errors that I havent seen in the past and undefined resources. Still trying everything to get this to build. Thank you for your help in this dark time!

        • synrgi says:

          Hey reppard, I sent you a pull request on github.com. I fixed all the references that should be giving you problems. Take a look at it, and if you want to try it, hit the big green merge button on the pull request.
          Then re-init your ~/android/system folder and run a repo sync -j16, should fix up your problems. Lemme know how it works!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.