yashsingh1/xdaforums huggingface dataset:
[Nexus 7 Android Development] kumite2010:
Hey fattire

thank you so much for making this thread. I would never have thought of trying to compile a rom by myself but this thread motivated me to at least try.

After a few nights of going through the instructions and working the rust off my minimal Linux/Ubuntu skills, today I finally got to the build part. For about an hour and half into compiling (I'm using my older computer for this project but the specs exceed the minimum requirements for Android) everything seemed to be proceeding well until the following lines were thrown:

"frameworks/av/services/audioflinger/AudioFlinger.cpp:6566:43: error: expected ')' before '{' token

frameworks/av/services/audioflinger/AudioFlinger.cpp:6590:25: error: expected primary-expression before '}' token

frameworks/av/services/audioflinger/AudioFlinger.cpp:6590:25: error: expected ';' before '}' token

frameworks/av/services/audioflinger/AudioFlinger.cpp: At global scope:

frameworks/av/services/audioflinger/AudioFlinger.cpp:6673:45: error: prototype for 'android::sp<android::AudioFlinger::RecordThread::RecordTrack> android::AudioFlinger::RecordThread::createRecordTrack_l(const android::sp<android::AudioFlinger::Client>&, uint32_t, audio_format_t, int, int, int, android::status_t*)' does not match any in class 'android::AudioFlinger::RecordThread'

frameworks/av/services/audioflinger/AudioFlinger.h:1438:61: error: candidate is: android::sp<android::AudioFlinger::RecordThread::RecordTrack> android::AudioFlinger::RecordThread::createRecordTrack_l(const android::sp<android::AudioFlinger::Client>&, uint32_t, audio_format_t, int, int, uint32_t, int, android::status_t*)

frameworks/av/services/audioflinger/AudioFlinger.h:1380:11: error: 'class android::AudioFlinger::RecordThread' is private

frameworks/av/services/audioflinger/AudioFlinger.cpp:6683:25: error: within this context

frameworks/av/services/audioflinger/AudioFlinger.h:303:11: error: 'class android::AudioFlinger::Client' is private

frameworks/av/services/audioflinger/AudioFlinger.cpp:6683:25: error: within this context

make: *** [out/target/product/grouper/obj/SHARED_LIBRARIES/libaudioflinger_intermediates/AudioFlinger.o] Error 1"

And the compile ended.

It seems the problem has to do with Audioflnger which after googling is the native audio system for Android.

I have no idea what could cause the problem or how to fix it besides doing a repo sync and starting over again but I would like your input before I go that route.

Any help would be appreciated. Thanks in advance
[Nexus 7 Android Development] fattire:
Try repo syncing again. Looks like something was checked in that broke stuff (and then more stuff that fixed it)

In other words... not your fault :) Just repo sync and rebuild and it should pick up where it left off and you will hopefully be good :)
[Nexus 7 Android Development] kumite2010:
Thanks for the reply.

Repo synced and recompiling. I'll let you know how it goes

Have a great night
[Nexus 7 Android Development] kirdroid:
Thanks for this guide...currently syncing source. Taking a long time ... but will see if i can build successfully.

I'm a windows developer so linux and all is little new but kind of understand whats going on. I have been flashing roms from couple of years but this is awesome. I would love to explore the source more and learn about the kernel's and roms. Should be really interesting learning all this.

Big thanks for making this guide...i always wanted to compile my own rom but never did, this got me started and hopefully i will learn a lot from this.

---------- Post added at 08:09 PM ---------- Previous post was at 07:47 PM ----------

Build is not starting because of the Java version mismatch. I downloaded the jdk-7u6-linux-x64.tar.gz from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1637583.html. I'm trying to build on Ubuntu 12.04 Virtual machine on OSx. Should i download older version of Java? Am i doing something incorrect?

============================================

Checking build tools versions...

************************************************************

You are attempting to build with an unsupported version

of java.

Your version is: java version "1.7.0_06".

The correct version is: Java SE 1.6.

Please follow the machine setup instructions at

https://source.android.com/source/download.html

************************************************************

************************************************************

You are attempting to build with the incorrect version

of javac.

Your version is: javac 1.7.0_06.

The correct version is: 1.6.

Please follow the machine setup instructions at

https://source.android.com/source/download.html

************************************************************

build/core/main.mk:155: *** stop. Stop.

---------- Post added at 08:16 PM ---------- Previous post was at 08:09 PM ----------

Ok resolved the java version error. Google android developer site lists below

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"

$ sudo apt-get update

$ sudo apt-get install sun-java6-jdk

But instead of $ sudo apt-get install sun-java6-jdk we need to use

$ sudo apt-get install openjdk-6-jdk

Found out from google search that sunsdk has been removed completely from partner archives so we need to use openjdk.
[Nexus 7 Android Development] gigoo25:
Finally did it! Compiled my own ROM from source. Thank you fattire for all your help. Turned out to be some sort of error with the virtual machine I was running... Works Just fine after a fresh install. Now to reaserch and understand on how to modify and add my own changes to the build :)
[Nexus 7 Android Development] kirdroid:
I'm so close...got everything to build perfectly.

When i try to run fastboot commands...im getting waiting for device. Any ideas? I tried different USB ports and made sure i selected Ubuntu when the prompt came in.

ubuntu:~/android/system/out/target/product/grouper$ fastboot erase cache

< waiting for device >
[Nexus 7 Android Development] fattire:
Hey, a big congrats to ya!

Sounds like maybe one of a few things are wrong...

1. Is the N7 is bootloader mode? (adb reboot bootloader) with "FASTBOOT MODE" in the bottom left?

2. Do you have the USB cable plugged in?

3. Not sure if Windows requires any special drivers or anything...?

4. Maybe try running fastboot in "superuser" mode:

sudo fastboot flash recovery recovery.img

(or whatever you're doing)

It'll ask for your admin password. "sudo" before a command means "do the following as the superuser" (aka "admin").

Another quick command-- say "time" before any command, e.g...

time mka bacon

This will tell you how long the command took to execute.
[Nexus 7 Android Development] kirdroid:
Thanks ... Yes N7 is in fastboot mode, usb plugged in and I'm using Ubuntu. Checked USB debuggin is on as well

I did google search and the say me to create the 51-android.rules files. I did the below but still not working. Do you know how did you create the udev files?

1. Open a terminal window.

2. Log in as root.

sudo -i

3. Create a UDEV rule file.

cat > /etc/udev/rules.d/51-android.rules

This should give you a blinking cursor at the very beginning of a blank line, it’s waiting for you to tell it what the file needs to contain.

I entered

SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4e40", MODE="0660"

5. Press CTRL + D to save, it should return you to the terminal prompt

6. chmod the new file

chmod a+r /etc/udev/rules.d/51-android.rules

7. Try fastboot. It should work now.

fastboot devices

Hopefully you get “Attached devices” with your devices serial number, if so, you’re good to go, fastboot should no longer hang at “waiting for device”. To be sure, try

fastboot reboot

If your device reboots, you win life.
[Nexus 7 Android Development] fattire:
if you type

lsusb

do you see the Nexus 7 listed?

Bus 001 Device 023: ID 18d1:4e42 Google Inc.
[Nexus 7 Android Development] .torrented:
So I ran it a few times and I kept getting an error

I tried to repo sync a few times and the build outcome was the same no update.zip file...

I switched to Ubunto 10.04 64bit and am currently getting the source (about 45min to completion) then im gonna try it again
[Nexus 7 Android Development] Seferi:
I deleted everything except .repo and downloaded the source twice already. It must be something about my repo manifest right? How can i fix this? Shall i delete .repo too ?
[Nexus 7 Android Development] .torrented:
Making progress with 10.04LTS using VMware Player (better then VirtualBox) My .img files are showing up in my output folder unlike before... I recommend using 10.04 64bit w/ VMware for people who are just starting out like me... Its cooking and something smells good :)

Oh and Unity in VMware is a really cool feature:
[Nexus 7 Android Development] sparksco:
I'm building on virtualbox and never had that issue. I'm also building on Ubuntu 12.10 but you have to be somewhat advanced to get everything set up to build on it. BTW why such a old version of Ubuntu? There's a lot newer versions that build just fine like the 11.x series.
[Nexus 7 Android Development] .torrented:
I tried 12.10, 12.04 and I just couldnt get it to want to cooperate with me. On Google's page they recommended 10.04 and it just worked for me and I finally got my rom cooked.

I actually like 10.04 more than 12.04/10 it seems a bit snappier.

I gave virtualbox a go and VMware Player is really cool and has some neat features like unity

TBH Im rather new to the whole linux thing so im still learning how to do some stuff and im always open to suggestions on anything really

all that matters is I figured out how to cook a rom and so far everything is working :) thanks fat_tire appreciate what youve done here
[Nexus 7 Android Development] azoller1:
Can you get more than 30gb on a VM? Cause I only get that much with wubi.exe as a server on windows
[Nexus 7 Android Development] .torrented:
you can set it to what you want i set mine to 60Gbs on VM's and i believe you can change it as you need more space later on
[Nexus 7 Android Development] sparksco:
I have 500Gb
[Nexus 7 Android Development] azoller1:
darn now im getting "fatal: no bootable medium found:system halterd" or something like that, do i need a cd in the cd drive?
[Nexus 7 Android Development] .torrented:
what are you trying to do exactly?
[Nexus 7 Android Development] azoller1:
Start Ubuntu in the virtual box on windows
[Nexus 7 Android Development] .torrented:
Hrm... I'm not too sure I only used VB for a few minutes I like VMware Player its a little more straight forward... Its free if you wanna give it a try instead...
[Nexus 7 Android Development] azoller1:
I actually fixed it now I just had to use a fixed location instead of a dynamic location
[Nexus 7 Android Development] sparksco:
I haven't tried VMWare but virtualbox works fine for me. Also it is free and is java based which is what android uses. It's really simple to be able to use adb/fastnoot as well with the USB pass-through feature. I just plug my nexus 7 in and choose the device to add.
[Nexus 7 Android Development] housry23:
It will build much faster if you partition your hard drive and install it natively with a dual boot. I started this way and have slowly migrated to Linux full time. I have to keep a windows drive around for some purposes, but I don't boot into windows unless I absolutely have to. I work on computers as a side gig and need windows for certain things and that's the only time I use it anymore.

BTW, Ubuntu 12.10 world's just fine. There are several guides here about setting up your build environment in 12.10. I prefer linux mint and am now successfully building in Mint 14. :thumbup: check the galaxy nexus general section. There's a guide there.

Also I found a nice guide specifically for setting up the build environment in Mint 14. If you've only tried Ubuntu, I suggest mint. It's based on Ubuntu and much prettier and easier to use imo. Great thing about Linux is the love cds! You can try a distro without making any changes to your computer.
[Nexus 7 Android Development] .torrented:
the thing is Linux/Ubuntu likes FAT32 instead of NTFS so I need an extra HDD to format it that way... or i would just set up a full linux environment.

on a side note what desktop do you recommend for Mint 14? KDE Cinnamon MATE or Xfce
[Nexus 7 Android Development] sparksco:
Mint is based on Ubuntu. Essentially its the same thing with a different desktop environment. Not really much different besides the look..
[Nexus 7 Android Development] SuperBoUDS:
I got this error when trying to build with Linaro 12.12

/opt/android-toolchain-eabi/bin/arm-eabi-ld: error: arch/arm/boot/compressed/piggy.gzip.o: unknown CPU architecture
/opt/android-toolchain-eabi/bin/arm-eabi-ld: error: arch/arm/boot/compressed/lib1funcs.o: unknown CPU architecture
[Nexus 7 Android Development] apascual89:
OK guys, I've been compiling for a while now and have learned to cherry pick and look around in github. How do I start modifying cm to my liking? I know this is a broad question. One example :

I want the dual pane view on the settings app. How could I achieve that?

Thanks and Merry Christmas!
[Nexus 7 Android Development] sparksco:
The kernel isn't compatible with Linaro toolchain.
[Nexus 7 Android Development] azoller1:
Well add the tablet ui from the thread here and edit the java files at least that's what I'm doing for my rom
[Nexus 7 Android Development] yogi2010:
thanks OP for the instructions updated for CM 10.1, i did my first build since CM 7 without a hitch.

i wondered if someone could elaborate on cherry-picking features that have not been officially added in. i read the quick guide(which i cannot locate at the moment), and it said to go to a download button on the right side of the code review page, but i don;t see any such button. thx anyone!

Edit: I forgot to mention/ask, everything went perfect with the build and flashing, but there seemed to be a glitch with Trebuchet Launcher, where my dock icons kept disappearing. Has anyone seen this, perhaps it's a little bug in the code? I noticed they didn't release an official nightly for 3 days( for tilapia anyway). In any case, Apex works perfectly, and I think I'm liking it better than Trebuchet anyway :)
[Nexus 7 Android Development] .torrented:
my icons went missing after I cooked my first rom up but after that they stayed when I flashed more that I had done
[Nexus 7 Android Development] yogi2010:
Huh, that's odd. Thanks for the reply. I'm cooking up another one now so I'll see how it goes.
[Nexus 7 Android Development] .torrented:
I was going from CM 10.1 Nightly 23 and then I cooked my variant of 24 and my bottom folders and icons were gone all that was left was the app drawer button. all i had done was just flashed over 23. But flashing over 24 to 25 (again my versions) the icons/folders stayed where I put them... nothing on my screens like widgets disappeared though.
[Nexus 7 Android Development] yogi2010:
Yeah, same here, it was just the icons/apps in the bottom dock that disappeared. Maybe it fixes itself somehow once you flash your second build on top of it.
[Nexus 7 Android Development] apascual89:
Trebuchet (the cm launcher) has been getting a lot of work done lately. I'm guessing the Issues with icons disappearing has to do with that. Just look at all the commits in the last three days alone.

http://review.cyanogenmod.org/#/q/s...anogenMod/android_packages_apps_Trebuchet,n,z
[Nexus 7 Android Development] yogi2010:
that's kinda what i figured about the launcher. i just wasn't sure if anyone had seen that same issue on the official nightlies.
[Nexus 7 Android Development] sparksco:
Yup, this is why I don't include trebuchet in my builds. I want my launcher to be usable and stable.
[Nexus 7 Android Development] .torrented:
So help me out here if I want to leave something out like that how do I do that when building my rom?
[Nexus 7 Android Development] sparksco:
You can build the stock launcher. Edit the file vendor/cm/config/common.mk and find the part that says

Trebuchet \

and remove it.

Then put this somewhere in the file

# AOSP Launcher
PRODUCT_PACKAGES += \
Launcher2

After that you will probably want stash your changes in a commit on a branch before repo sync. And also remove Trebuchet.apk from system/app/Trebuchet.apk in your output directory.
[Nexus 7 Android Development] #define:
Hey guys, can someone tell me the size of the CM10 repo?? I've downloaded 10.4 GB so far...
[Nexus 7 Android Development] iDavidStory:
Here is what I have:

15G	aosp

14G	cm-10.1

14G	jellybean (cm-10)
[Nexus 7 Android Development] fattire:
That's good to know actually. Does this include the device/kernel & vendor stuff that was extracted? How about the object files? (is this the size of raw source or a completed build?) People ask me all the time how much room you "really" need...
[Nexus 7 Android Development] yogi2010:
My working folder is 24.2 GB, that's after doing a build with proprietary files, with the update zips and everything still there, haven't done clobber or make clean. Tilapia version
[Nexus 7 Android Development] fattire:
Okay so 25-30GB sounds reasonable... maybe 30GB to stay on the safe side...
[Nexus 7 Android Development] #define:
I just needed the download size... I have dload speeds of around 30-50 kbps... So I have to keep my laptop running for days at a stretch... and for 6 days I've been downloading CM10 source, and it has downloaded the same file cluster (613731) objects, around 950 mb, 3 times... is that normal??

---------- Post added at 03:03 AM ---------- Previous post was at 02:44 AM ----------

I have another question.. I found the 'reference' tag that can be used with repo init if you're trying to sync more than one sources...

So my question is, is there some sort of compatibility between sources?? For eg, can I use CM10 reference can be used to sync AOSP??
[Nexus 7 Android Development] sparksco:
If your on a really old version of Ubuntu it will have a older version of python which has a lot of issues with the repo script. I remember having syncing issues before but on Ubuntu 12.10 it's fine. Of course it could be your ungodly slow DL speeds. You really should only DL on Wi-Fi with these types of large data transfers. Data can get corrupted to easily...
[Nexus 7 Android Development] #define:
The funny, yet rather sad thing is, I use Wi-fi only... And I use Ubuntu 11.10...
[Nexus 7 Android Development] sparksco:
WiFi with 30-50kbps speeds? I get faster speeds on mobile network...

I guess 11.10 isn't "that" old.
[Nexus 7 Android Development] yogi2010:
Yeah, it must be the WiFi, I did everything without a single hitch on Ubuntu 10.04! I'm kinda waiting to get a new laptop to upgrade, because the later versions of Ubuntu have graphical glitches on my machine. Plus last time I checked 10.04 was still the version recommended by JBQ over at aosp... Although maybe that has changed by now :D
[Nexus 7 Android Development] sparksco:
Nah they are just lazy to update the building instructions. Everything builds flawlessly for me on 12.10...

Although I'm running a 8 core :)

If you want checkout out my tilapia guide for building my ROM on Ubuntu 12.10 and just replace some things from this guide to build CM.

http://xdaforums.com/showthread.php?t=2038231
[Nexus 7 Android Development] #define:
Internet is very costly... for me anyway... I get connection errors during repo sync all the time.. 'couldnt connect to remote' and such...
[Nexus 7 Android Development] .torrented:
Same here everything is working fine for me on 10.04... I can pump out a fresh build in about 35 minutes

Me too, what CPU do you have. I only use 4 cores to power my VM though.
[Nexus 7 Android Development] SuperBoUDS:
How can I exclude this from my build, or replace with another kernel such as motley or faux?
[Nexus 7 Android Development] housry23:
I prefer cinnamon. Many like mate. If I am using Ubuntu, I normally install Xfce. Fyi, if you have a big enough hard drive, you don't have to format the whole thing to ext4. You can have a Windows partition and a Linux partition on the same drive. Ubuntu or Mint installer will partition it for you and give you a dual boot option every time you start your computer.

Mint is based on Ubuntu. They have changed the desktop and added things to make it easier to use. They have also left things in that Ubuntu used to have or has hidden from the user. It's much more admin friendly imo.
[Nexus 7 Android Development] sparksco:
You can't build other kernels with cm ROMs unless you change a lot of things in the source, but I'm not going to get into all of that...

I'm using Google's newer 4.7 toolchains from their master branches and they work great:

https://android.googlesource.com

The arm ones are here:

https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/

https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/

If you try to use these you'll probably need quite a few patches for the ROM to get a successful build. Possibly a patch for the kernel as well. Check on Google's master branches for patches if your build fails.
[Nexus 7 Android Development] yogi2010:
is it possible that you could pick a moment in time to sync when something is broken in the code? last night my build stopped at something to do with Trebuchet translations, or something. so i re-synched, and then it seemed to halt at something to do with Settings.apk.

the only thing i did different was make clobber first, and for the first time i got a warning about using the wrong version of Java. this was after doing a few builds with no hitches at all. i might add, it gave the Java warning while executing the make clobber command, not when building.

anyway, i ended up deleting my working folder, resynching the whole repo, and now am in the middle of building again...

Update: my build still errored out at Settings.
[Nexus 7 Android Development] yogi2010:
Thanks for this tip! The Settings thing seemed to work itself out, but my builds kept halting at Trebuchet, so I followed this to remove it, and all is good now, the build completes.
[Nexus 7 Android Development] smo1970:
It is very possible. It actually happened to me after I have building successfully for a couple weeks. It also was an issue with Trebuchet. I tried several things to resolve it and finally a repo sync fixed. I checked the change log and found the exact issue had been documented.

I'm now building without issue again.

My problem with watching the change log is my OCD gets the best of me. Now instead of building nightlies for my nexus I'm building hourlies. :screwy:
[Nexus 7 Android Development] fattire:
Hehehe :) This is a good sign. It means that soon you'll be making your own tweaks, and contributing them back for everyone's benefits.. it will be an irresistible next step...
[Nexus 7 Android Development] mateorod:
A big part of why they are holding on to the older Ubuntu versions is that old versions of Android (Cupcake, and maybe Donut) aren't building on Ubuntu 11+. You won't have any problems building anything for the Nexus line on the later releases.
[Nexus 7 Android Development] sparksco:
I use all 8 cores but I set a cpu cap of 80-90%

I don't see the point in stressing out 4 cores while the others do nothing especially if my host OS is idling.

---------- Post added at 04:01 PM ---------- Previous post was at 03:59 PM ----------

Yeah I don't see why they hold onto the older platforms honestly. Gingerbread sure but anything less seems pointless.
[Nexus 7 Android Development] #define:
Is it possible to go back a version on N7?? For, eg, can I use ICS or GB on an N7 that came preinstalled with JB?? No particular reason to do it, just wanna know if android is backwards compatible..
[Nexus 7 Android Development] .torrented:
I like to play games while I wait ;)
[Nexus 7 Android Development] housry23:
Anything is possible, but it won't work out of the box. You would have to do a lot with drivers and kernel to make it work. It would be way too much work and no benefit.