yashsingh1/xdaforums huggingface dataset:
[Nexus 7 Android Development] S0ckM0nk3y:
Totally forgot I reserved this spot lol. Anyways great guide fattire. For those of u that want to learn how to build from source whether its cm, aokp, bamf, aosp or whatever u want to build this guide is a great start. While this guide is strictly for CM it will give u an understanding of the steps of building from source. Great work again fattire.
[Nexus 7 Android Development] biohazrd51:
Highly highly

highly

recommend for anyone that loves to flash ROMs, but never built one before. fattire is one of several who have done absolute wonders for the Nook Color community. Not just developing for the device, but pulling people together to get this stuff running. :good:
[Nexus 7 Android Development] mateorod:
I am one of the obsessives who almost didn't buy this machine when I saw they yanked the sdcard. But when fat-tire said he was getting one, I immediately went to the Play store.

His walk-thru for encore ICS was how I first learned to build. I have been building CM10 for my grouper for several weeks, although the repo sync was incomplete. I ended up having to write m own cm.mk files as well as several other weird little changes in order to make it boot. Glad those changes are finally checked I, I am going to delete my home-baked files so I can get any changes from upstream.

I have an issue I am hoping you can shed some light one, fat-tire. Inconsistencies in the ContentResolver file between my builds and those in Official Cyanogen night lies. I haven't seen any commits that change those files.

I have asked eyeballer about it, but he isn't sure either. I am building a clobber right now, but if I still have the issue, I will post particulars.

I am real glad to see you here...it has been a pretty wild and wooly forum thus far...
[Nexus 7 Android Development] fattire:
Whoa. How come this thread got moved from Nexus 7 Android Development to Nexus 7 General? I can't think of anything more Develop-y than building Android.

In any event- thanks all for the kind words. Mateorod, not sure from your description what issue you're having. I'll def. need more specifics.

Glad you got the N7? I am-- I use it for hours daily...
[Nexus 7 Android Development] h00py:
Hey, n00b builder here. First off big thanks for posting the guide :) I'm afraid I'm having a problem though. Once I've sync'd the cyanogenmod repo I don't seem to have "asus/grouper" in my device folder. Any idea what I could've done wrong?
[Nexus 7 Android Development] fattire:
Try this...

Did you try the "lunch grouper" command? (you have to do . build/envsetup.sh first as described in the documents)

If this command doesn't work, you may need to add these directories to the repository manifest (a list of all the different projects that make up CM10). To add it to the list, try creating a file called local_manifest.xml in the .repo directory (it is a hidden directory as it starts with a period) and put this in the file:

<?xml version="1.0" encoding="UTF-8"?>

<manifest>

<remote fetch="git://github.com/" name="gh" review="review.cyanogenmod.com" />

<project name="CyanogenMod/android_kernel_asus_grouper" path="kernel/asus/grouper" remote="github" revision="jellybean" />

<project name="CyanogenMod/android_device_asus_grouper" path="device/asus/grouper" remote="github" revision="jellybean" />

</manifest>

Alternately, you can do it this way from your root (~/android/system or wherever you put the source)

curl https://raw.github.com/gist/dcef0eadc4c8d31ae46d/d27a0cc718607b1a6e4958f9d0e57887b2eb4eb3/gistfile1.xml > .repo/local_manifest.xml

This local_manifest.xml file will add the needed grouper repos to the manifest. So then just repo sync again and see if they show up. If so, let me know and I'll add it to the instructions.

Update: I added it to the instructions. Let me know if it works. At some point these will be added to the official manifest so the local_manifest.xml won't be needed.
[Nexus 7 Android Development] h00py:
Deleted my whole source folder and started again following the updated instructions. Everything worked fine this time. It's building now and I'll report back if/when it finishes.

Thanks again for the help :D
[Nexus 7 Android Development] fattire:
Heh np. Thought you didn't need to delete the folder-- the nice thing about repo sync is that it will update everything automatically, even if you change the manifest :)
[Nexus 7 Android Development] MusicNutt:
As a linux nerd, I thank you.
[Nexus 7 Android Development] fattire:
TWRP2 instead of CWM

So we're back in the Android Development forum.

Update: I hear there's a non-N7-specific permissions issue (the build sets perm 0600 on /tmp) when building TWRP2 in jellybean source. Until this is resolved, consider the below purely informational. In other words, don't try it yet until the code is updated. (Thanks, eyeballer for letting me know)

-----

Here's another quick tip-- if you want to build TWRP2 recovery instead of ClockworkMod recovery for the Nexus 7, add the following two lines to the local_manifest.xml file (where the similar-looking lines are):

<remove-project name="CyanogenMod/android_bootable_recovery" />

<project path="bootable/recovery" name="TeamWin/Team-Win-Recovery-Project" remote="github" revision="master"/>

Assuming I typed that right, when you repo sync, this will replace the cwm source with the twrp source. When you then do your next build, your recovery.img in $OUT will be TWRP2. It can then be flashed with fastboot per the instructions.
[Nexus 7 Android Development] h00py:
Build competed & flashed with no problems. :victory:

/proud
[Nexus 7 Android Development] fattire:
Welcome to the club!

Woo! Congrats! :cyclops:

Now that you have your build going, you can try out some of the experimental commits that are sitting on CyanogenMod's code review site. These are commits with new features and bugfixes that may be experimental but need people to try them and report back if they work or not.

If you're interested in risking everything, first go to review.cyanogenmod.com AKA Gerrett and find a proposed commit that looks interesting. Read any comments or caveats that may apply, and have a look at the code itself to make sure it looks okay. Each proposed commit is part of a specific git project, listed under "Project", that correspond to directories in your source code. For example, CyanogenMod/android_frameworks_base corresponds to the repository in frameworks/base.

To try one, click on the little brown icon halfway down the web page under Downloads, on the right. This will copy the instructions to the left to the copy buffer. Then, cd to the appropriate repository directory in your source code and paste the command. It should download and commit the patch. You can check it by typing "git log" and looking for the commit at the top of the list.

If all went well, you can rebuild and hopefully will see your change in the new build. The next time you repo sync, the commit you made will be lost (unless the proposed commit actually was merged into mainstream), so if you want it again, you'll need to re-download it using the method described above.

That's it! Way to stay bleeding edge!
[Nexus 7 Android Development] Rafase282:
Hello, I have never built a rom from source before but I will use this guide and try it out. Specially since I want to use linaro.

Do you think you could link me or help me get this working? As far as I understand instead of using g++ or so I woudl use the linaro tools to compile and so. How much different would this be from your instructions?

How can I get linaro?

I'll be researching into this but I hope you can provide an answer.
[Nexus 7 Android Development] fattire:
I built linaro optimized cm9 for nookcolor (OMAP3) a few months back (thread starts around here). Some of the linaro optimizations to libc and the frameworks already have been added to the ICS source and I assume the Jellybean source has it already too for CM10 (and they have been adopted upstream by Google I believe as well). I haven't tried to build the grouper kernel using 4.7-- the 2.6.32 kernel and 3.0.8 kernels for NT and NC required a few minor changes-- the grouper kernel may or may not need them... but I know what to do if someone wants to try it.

Before trying linaro stuff, I would focus first on getting the build to work normally. Familiarize yourself with the process, and then investigate linaro. The system is so ridiculously fast IMO... I guess even faster is better, but I don't have any complaints :)
[Nexus 7 Android Development] Rafase282:
I'm currently downloading source. It is taking its sweet time. ... nvm it just finished.

But I'm going to try to build and if everything goes well I will check into "cherry picking" and make my own personal custom build. I want to use linaro for the rom and kernel.

---------- Post added at 06:08 AM ---------- Previous post was at 05:10 AM ----------

mkdir -p out/target/product/grouper/recovery/root/res/

host C: libz <= external/zlib/zutil.c

cp -fr bootable/recovery/gui/devices/common/res/* out/target/product/grouper/recovery/root/res/

cp -fr bootable/recovery/gui/devices//res/* out/target/product/grouper/recovery/root/res/

cp: cannot stat `bootable/recovery/gui/devices//res/*': No such file or directory

make: *** [out/target/product/grouper/obj/STATIC_LIBRARIES/libgui_intermediates/twrp] Error 1

make: *** Waiting for unfinished jobs....

rafase282@rafael-Desktop:~/android/system$

yup I should have read the whole post

---------- Post added at 06:30 AM ---------- Previous post was at 06:08 AM ----------

I reverted back but im still having problem building.
[Nexus 7 Android Development] mateorod:
Ha, I lost the thread. They shouldn't play like that.

Yeah, I am glad. I have a project that requires java on-device, and the Nook just couldn't quite make it. But this thing can crunch through it, been though the temp spikes almost 20 degrees in the process!

I don't really want to derail all these first time Android ninjas coming out efforts. I have fund a workaround of sorts. It is just that I port some software to end users by decompiling system apps from patched builds, creating patches and applying them to end-user ROMs. Kind of a way fr people who don't or can't build to have access to certain software.

This process works like a charm on unofficial builds from any source. I pretty much could guarantee successful patching on CM9 night lies. But whenever an official RC or Final would come out, the patches would never work for those builds, while continuing to work for unofficials of the same day as well as the surrounding.

The same thing has just happened for official JB nightlies. We have tried matching the builds commit for commit, the whole thing.

I went into greater depth than I intended. If you know, awesome, if not, I will go start a thread somewhere and take it up there. This thread has a grander purpose.

Thanks!
[Nexus 7 Android Development] duplissi:
definitely gonna give this a go on my next day off.
[Nexus 7 Android Development] Rafase282:
I started over, fresh ubuntu install and everything, I follow the steps and while it is building the computer just shutdown.

I turn it back one and try again and then I get errors.

I'm going to try again redoing the steps to see if that will fix anything.

When getting the blobs from my device I get this.

Pulling /system/vendor/lib/libwvm.so to ../../../vendor/asus/grouper/proprietary

remote object '/system/vendor/lib/libwvm.so' does not exist

Edit: got it from a stock rom I guess this is cause I'm using EOS build.
[Nexus 7 Android Development] riggs170:
I would also like the info link does not work
[Nexus 7 Android Development] fattire:
Hang on. I'll fix it.

Update: fixed. Kan.gd is dead though. That's not good. Unless it's godaddy screwing up.
[Nexus 7 Android Development] kryptik06:
Can some reupload the guide. The link is dead
[Nexus 7 Android Development] totalentropy:
Anonymous appeared to have taken down all of GoDaddy's DNS servers. If you were hosting on GoDaddy, that would be why it's down.
[Nexus 7 Android Development] totalentropy:
GoDaddy has been restored and the link now works.
[Nexus 7 Android Development] trailblazerz11:
Got the same error.

Tried repo sync -j3 didnt work

repo sync -f gives Syncing work tree: 88% (272/308) error: revision refs/heads/jellybean in CyanogenMod/android_prebuilt not found
[Nexus 7 Android Development] sparksco:
Sounds like DNS issues to me. Try THIS

But instead of

$ nslookup googlesource.com
$ nslookup android.googlesource.com

Do

$ nslookup github.com
$ nslookup https://github.com

Then to enter the information into the file you have to open it as root.

$ sudo gedit /etc/hosts

Let me know if it works or not
[Nexus 7 Android Development] dsuycott:
something is happening! we'll see...thank you!
[Nexus 7 Android Development] thomaswp:
I am trying to get this working and making notes as I go. I managed to build the recovery and boot images, but no zip.

----- Making recovery image ------
out/host/linux-x86/bin/mkbootimg --kernel out/target/product/grouper/kernel --ramdisk out/target/product/grouper/ramdisk-recovery.img --output out/target/product/grouper/recovery.img
Made recovery image: out/target/product/grouper/recovery.img
Copy: out/target/product/grouper/system/app/RomManager.apk
Copy: out/target/product/grouper/system/app/Term.apk
make: *** No rule to make target `vendor/cm/proprietary/lib/armeabi/libjackpal-androidterm4.so', needed by `out/target/product/grouper/system/lib/libjackpal-androidterm4.so'. Stop.

Based on an earlier post in this thread I thought it might be the ./get-prebuilts, since it *had* thrown an error when I ran it. Here is the output today:

./get-prebuilts
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2548k 100 2548k 0 0 676k 0 0:00:03 0:00:03 --:--:-- 752k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 128 100 128 0 0 142 0 --:--:-- --:--:-- --:--:-- 210
100 24900 100 24900 0 0 21064 0 0:00:01 0:00:01 --:--:-- 219k
Archive: ./proprietary/Term.apk
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of ./proprietary/Term.apk or
./proprietary/Term.apk.zip, and cannot find ./proprietary/Term.apk.ZIP, period.

Someone asked for the contents of the proprietary folder:

thomas@venus:~/android/system/vendor/cm/proprietary$ ls
RomManager.apk Term.apk

I'm running a completely fresh installation of Ubuntu 12.04 and am now rather stuck.

Thanks for any help.

Edit: I looked at the get-prebuilts file and checked the links. It looks like that script is looking for a file that does not exist

https://github.com/downloads/jackpal/Android-Terminal-Emulator/Term.apk gives file not found.

I installed the Android Terminal Editor on my nexus, found the file in /data/app using root explorer, sent it to dropbox, downloaded it, renamed it to Term.apk, commented out the two curl lines in get-prebuilts and ran it again. It worked. I love the internet. No idea if it solves my build problems, but I am closer.
[Nexus 7 Android Development] kumite2010:
Looks like I'm not the only one having problems. Since Friday night I've been having issues with android_prebuilt.

I found a tutorial to clone that directory and then was able to fully complete repo sync but when trying to download Rom manager I got the same error message as someone else posted

This prompted me to delete my android folder and start all over again but now I get the pre_built error once more. I'm trying the DNS tip right now but I'm not home so I don't know if it worked or not

Update: Just got back home. No luck with the DNS tip: Still getting the same error message as everyone else with android_prebuilt. Really sux
[Nexus 7 Android Development] sparksco:
It should look something like this in your /etc/hosts

207.97.227.239 github.com
69.16.143.24 https://github.com
66.152.109.24 https://github.com

Works fine for me not getting any errors on android_prebuilt...
[Nexus 7 Android Development] kumite2010:
Hmm...the address I'm getting when I use nslookup... are different from the ones you have listed. I'll use yours and see what happens.

And are you doing repo sync from a completely new set up? Because when I cloned the android_prebuilt directory I didn't get any errors either but I did get a bunch of compiling problems which is why I had to start over. I think once you have an android_prebuild directory already present you won't get any errors.

I'll keep you updated

---------- Post added at 08:24 PM ---------- Previous post was at 07:38 PM ----------

Unfortunately still getting an error:

"remote: Counting objects: 20800, done.

remote: aborting due to possible repository corruption on the remote side.

fatal: protocol error: bad pack header

remote: Counting objects: 20800, done.

remote: aborting due to possible repository corruption on the remote side.

fatal: protocol error: bad pack header

error: Cannot fetch CyanogenMod/android_prebuilt"
[Nexus 7 Android Development] sparksco:
I haven't done any repo syncs today (9/11 and all...) but I'll try tomorrow and see if I get any strange errors like that. Just to make sure your android_prebuilt repo isn't corrupted do $ rm -rf .repo/projects/prebuilt.git prebuilt

Might not help but worth a try
[Nexus 7 Android Development] Neo:
This helped me finish my CM9 build Thank you. It was only recently that the file became nonexistent for some reason. I re-installed Ubuntu and started over only to run into this very problem.

Thank you for figuring it out.

-Neo
[Nexus 7 Android Development] thomaswp:
It didn't help me! I got

/bin/bash: xmllint: command not found

Which looks solvable.

sudo apt-get install libxml2-utils

On to the next problem!
[Nexus 7 Android Development] kemonine96:
You need the libxml2 package I believe. You may also need libxml2-utils.
[Nexus 7 Android Development] sparksco:
I used this guide to install packages because Google's website is missing a bunch. Also works fine on Ubuntu 12.04

http://xdaforums.com/showthread.php?t=1505006
[Nexus 7 Android Development] kemonine96:
I've been receiving the same error for the last few days and I don't think it is related to a corrupt clone. I've tried deleting my repo working directory and restarting numerous times. There are a number of reports of users having trouble when a repo contains large binary files or too many large binary files. I also discovered that it may be possible to use an http:// url instead of a git:// url to work around the problem.

After monkeying around a bit I think I have a process that will let you sync the repo cleanly. I am at the fetch step in the below code snippet and my clone operation has gotten much farther than my previous attempts. Specifically it finished the "compressing objects" step and is 256Mb into the fetching objects step where before it never made it to the fetching objects step.

# cd /path/to/cm/root
# cd .repo/projects/prebuilt.git
# edit config and change url prefix to git:// to http://
# git fetch github
# edit config and change back to git://
# cd /path/to/cm/root
# repo sync
[Nexus 7 Android Development] sparksco:
repo sync -j8
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 1), reused 4 (delta 1)
Unpacking objects: 100% (4/4), done.
From https://github.com/pbeeler/android
ec9aa1e..3c8c503 jellybean -> origin/jellybean
project .repo/manifests/
Updating ec9aa1e..3c8c503
Fast-forward

Fetching projects: 1% (4/321) remote: Counting objects: 8, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 1), reused 4 (delta 1)
Unpacking objects: 100% (4/4), done.acking objects: 75% (3/4)
From https://github.com/pbeeler/android
ec9aa1e..3c8c503 jellybean -> ta/jellybean
Fetching projects: 5% (17/321) remote: Counting objects: 11, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 3), reused 6 (delta 3)
Unpacking objects: 100% (6/6), done.
Fetching projects: 6% (20/321) From https://github.com/pbeeler/android_device_asus_grouper
9cbc458..ede2c6d jellybean -> github/jellybean
Fetching projects: 68% (219/321) remote: Counting objects: 11, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 6 (delta 5), reused 6 (delta 5)
Unpacking objects: 100% (6/6), done.npacking objects: 16% (1/6)
Fetching projects: 72% (232/321) From https://github.com/pbeeler/Kernel-Grouper
+ ac3467f...c73594b jellybean -> github/jellybean (forced update)
+ 7bf2085...ac3467f testing -> github/testing (forced update)
Fetching projects: 78% (251/321) remote: Counting objects: 104, done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 67 (delta 40), reused 52 (delta 25)
Unpacking objects: 100% (67/67), done.
Fetching projects: 79% (254/321) From https://github.com/pbeeler/android_packages_apps_Settings
4b64e30..da14727 jellybean -> ta/jellybean
Fetching projects: 86% (277/321) remote: Counting objects: 128, done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 86 (delta 49), reused 75 (delta 39)
Unpacking objects: 100% (86/86), done.acking objects: 50% (43/86)
Fetching projects: 93% (299/321) From https://github.com/pbeeler/android_frameworks_base
8cebbed..b37a766 jellybean -> ta/jellybean
Fetching projects: 99% (318/321) remote: Counting objects: 23, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 13 (delta 7), reused 11 (delta 5)
Unpacking objects: 100% (13/13), done.
From https://github.com/pbeeler/android_vendor_cm
6e9c32d..c01064a TA -> ta/TA
Fetching projects: 100% (321/321), done.
Syncing work tree: 100% (321/321), done.

frameworks/base/: discarding 4 commits
packages/apps/Contacts/: discarding 2 commits
packages/apps/DeskClock/: discarding 2 commits
packages/apps/Settings/: discarding 6 commits

Still working fine here, everything syncs fine with -j8

And just to note I did repo init with https intead of git.
[Nexus 7 Android Development] kryptik06:
btw your not getting the repo from cyanogen

going to try the try change git to https and see if this works. Will post a update
[Nexus 7 Android Development] kryptik06:
Yea I know.. Was trying to point out the fact that cyanogen link is messing up rather then his link

Yep got it to work aswell changing the "git" to "https"

so the temp fix would be type

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

and then sync, instead of "repo init -u git://github.com/CyanogenMod/android.git -b jellybean"
[Nexus 7 Android Development] sparksco:
That is correct my repo manifest pulls prebuilt repo from CyanogenMod. I'm only using a handfull of my own repos.

---------- Post added at 10:41 PM ---------- Previous post was at 10:40 PM ----------

That has nothing to do with the problems your having.

Your welcome, glad it worked for you...
[Nexus 7 Android Development] kryptik06:
well i can pull akop and asop just fine just not cyanogen, unless i change git

edit: great guide btw op
[Nexus 7 Android Development] fattire:
Thx. For those trying to build in the last 3 hours or so, you may have experienced some turbulence with repo sync due to some major merging. All should be good now.
[Nexus 7 Android Development] p0isonra1n:
I get this error when I run the extract-files.sh

Any way to fix this?
[Nexus 7 Android Development] kryptik06:
are you in the right directory as your device?
[Nexus 7 Android Development] p0isonra1n:
Yea i am, i guessing its because the directory in which adb is in is not in the PATH. I have tried adding it and it still doesn't work.
[Nexus 7 Android Development] kryptik06:
hmm.. did you double check to see if your patch was correct in the bashrc

also double check to see if your development option in settings is set to debugg and root permision for apps/adb
[Nexus 7 Android Development] p0isonra1n:
I don't know how to do that. Can you please explain to me how, thanks.
[Nexus 7 Android Development] kryptik06:
if your on linux open up terminal and type gedit /,bashrc

then from there add the paths at the bottom