Android OS Forum banner
Status
Not open for further replies.

[TUTORIAL] So You Want To Build AOKP ICS for the Toro? [Ubuntu 10.04]

106K views 269 replies 96 participants last post by  ProTekk  
#1 · (Edited by Moderator)
This is strictly just a reference guide/tutorial! If you cannot simply follow directions and copy/paste, I'm not going to help you! This is idiot-proof.

Build Environment
  • Operating system -- Tested on Ubuntu 10.04 (64bit)
  • Terminal
  • Decent hardware (minimum of at least a dual core CPU and 4 GB of RAM)
  • Optimally have an SSD (standard mechanical drives work as well but slow down the process drastically)
  • Must have required packages for building installed, I will list them further down
Required Packages

Simply copy and paste this in a terminal window:​

Code:
sudo apt-get install curl git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib

Let that install and then proceed.​

Getting the Source
  • Make required directories
  • Obtain repo binary
  • Add repo binary to your path
  • Give repo binary proper permissions
  • Initialize empty repo
  • Sync repo
Alright, so now we're getting there. I have outlined the basics of what we're about to do and broke them down as I know them. This is all pretty much going to be copy/paste so it'll be fairly difficult to screw this up :)

Copy/paste:​

Make directory for repo binary
Code:
mkdir ~/bin

Add directory for repo binary to your path
Code:
PATH=~/bin:$PATH

Download repo binary and place it in the proper directory
Code:
curl [URL=https://dl-ssl.google.com/dl/googlesource/git-repo/repo]https://dl-ssl.google.com/dl/googlesource/git-repo/repo[/URL] > ~/bin/repo

Give the repo binary the proper permissions
Code:
chmod a+x ~/bin/repo

Create directory for where the AOKP repo will be stored and synced
Code:
mkdir ~/aokp

Move to our new AOKP directory
Code:
cd ~/aokp

Initialize the AOKP repo and download the manifest
Code:
repo init -u [URL=git://github.com/AOKP/platform_manifest.git]git://github.com/AOKP/platform_manifest.git[/URL] -b ics

Sync AOKP source
Code:
repo sync

Start the build

This is probably the EASIEST part of all, simply copy/paste this command and walk away!​
Code:
. build/envsetup.sh && brunch toro

Syncing the repo is dependent upon your Internet connection. It can take anywhere from 30 minutes to several hours to fully sync. Same thing goes for build times. Don't expect this to be short. If you have patience and have no build errors, you'll end up with a flashable zip in ~/aokp/out/target/product/toro! Happy crack-flashing!​

** 04/21/12 Edit - fixed repo init branch to reflect ics rather than master. - ZB
 
#4 ·
Make sure everyone knows that syncing the repo doesn't always ensure full functional builds. All dependant on what has/has not been pushed and committed in Team Kangs git . Updates are made all the time by Roman and crew, and knowing how to interpret source code and make ROMS is a lot different from just build setup lunch and ota make. Love that u are doing this for the community though...its a good way for people to at least start reading and stop just requesting lol

Sent from my Galaxy Nexus using Tapatalk
 
#9 · (Edited by Moderator)
Is everyone getting this error below?

* [new tag] android-sdk-4.0.3_r1 -> android-sdk-4.0.3_r1
* [new tag] android-sdk-adt_r16.0.1 -> android-sdk-adt_r16.0.1
Fetching projects: 24% (60/249)
error: Exited sync due to fetch errors

edit...seems to happen when it reaches sdk, i think I should maybe update it, lol!
 
Save
#14 ·
Is there any difference with using Ubuntu 11.04? Or should I stick with 10.04?

I'm about to switch from fedora and wanted to use 11.04 but not if it will give me issues

Sent From Nexi - The Galaxy Nexus
 
#15 ·
You can use 11.04, but I believe there are some additional things that need to be setup. I was reading about it in a thread somewhere, so I decided to just go with 10.04. Most tutorials are for 10.04 anyways, so If your new to building, that may make it easier.
 
#17 ·
10.04lts and lower are by far the best for compilation. You will start to run into problems after you install every thing and tell it to build. What really sucks is it takes about 20-30 minutes of compilation to error out. I believe it has to do with a kernel conflict in the newer versions of Ubuntu.
Do your self a favor and stick with the 10.04
Image


Sent from my Galaxy Nexus using Tapatalk
 
#19 ·
I'm not saying you can't use other flavors of Linux by any means, I'm just saying it goes much smoother with 10.04. Tons of reading + copy and paste tutorials available with 10.04. Also from experience ( 11.10 ) with other Ubuntu renditions I can tell you the headaches are more trouble then their worth.

Sent from my Galaxy Nexus using Tapatalk
 
#20 ·
Agreed. Though I finally got everything working on 11.10, it took lots of reading, experiementing, and a couple full ubuntu re-installs.

I am by no means an ubuntu expert, but I had success with 11.10 after changing lib32readline5-dev to lib32readline-dev and then a "sudo apt-get install libx11-dev:i386".

Thanks for the tutorial!

I'm not saying you can't use other flavors of Linux by any means, I'm just saying it goes much smoother with 10.04. Tons of reading + copy and paste tutorials available with 10.04. Also from experience ( 11.10 ) with other Ubuntu renditions I can tell you the headaches are more trouble then their worth.
 
#25 · (Edited by Moderator)
Anybody have a idea how to eliminate this error? It happens at the very end of my compile, about 45 minutes into it, that is the end right? Anyway, the error is posted below, Thanks.

running: java -Xmx2048m -jar out/host/linux-x86/framework/signapk.jar -w build/target/product/security/testkey.x509.pem build/target/product/security/testkey.pk8 /tmp/tmpWhrgGY out/target/product/toro/aokp_toro-ota-eng.corey.zip
Could not create the Java virtual machine.

ERROR: signapk.jar failed: return code 1

make: *** [out/target/product/toro/aokp_toro-ota-eng.corey.zip] Error 1

EDIT...when i ran the Java -Version in terminal I didnt have one, so I installed the JDK and am trying again. I used brunch and got the same error
Image


corey@corey-desktop:~$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (6b20-1.9.10-0ubuntu1~10.04.3)
OpenJDK Server VM (build 19.0-b09, mixed mode)
 
Save
#27 · (Edited by Moderator)
Protekk, who should I get in touch with to talk about porting AOKP to another device that already has a running ICS? I'm willing to do the leg work on testing, getting it up and running and taking ownership of the device, but I don't want to step on toes etc since this project has the potential to bring a lot of functionality to a device that has little in the way of ROM/ICS support. (PS I've synced the repo and built AOKP for toro once already and have AOKP installed on my HP Touchpad as well, now for the other ICS device in the house :) )
 
#30 · (Edited by Moderator)
After un-installing then re-installing JAVA JDK I continued to get the error below. What I found that JAVA was trying to grab 2 GB of RAM from this line running: java -Xmx2048m -jar out/host/linux-x86/framework/signapk.jar The fix is to go into /aokp/build/tools/releasetools/common.py and change the Xmx2048m to Xmx1024m After doing this my build was successful!

The error I was getting

Could not create the Java virtual machine.

ERROR: signapk.jar failed: return code 1

source of fix >>> http://rootzwiki.com...post__p__318890

EDIT....changed Xmx1024 to Xmx1024m after mrreed2u pointed out I left off the m. Thanks mrreed2u!
 
Save
#195 ·
After un-installing then re-installing JAVA JDK I continued to get the error below. What I found that JAVA was trying to grab 2 GB of RAM from this line running: java -Xmx2048m -jar out/host/linux-x86/framework/signapk.jar The fix is to go into /aokp/build/tools/releasetools/common.py and change the Xmx2048m to Xmx1024 After doing this my build was successful!

The error I was getting

Could not create the Java virtual machine.

ERROR: signapk.jar failed: return code 1

source of fix >>> http://rootzwiki.com...post__p__318890
Worked for me except the edit needs to be to Xmx1024m not Xmx1024. small typo but makes all the difference in the world.
 
#31 ·
Thanks for taking the time to do this ProTekk! Great job!

Verizon Galaxy Nexus
AOKP Build 22, Stock kernel,
4.0.4 Bootloader and Radios.
Sent via Tapatalk :)
 
Save
#34 ·
the android community is fantastic and incredibly supportive but there is some homework you need to do on your own. My advice is read a few how to's on the desired topic ( in this case how to theme for 4.0.x android ), set up your build environment, compile a rom from source, crack it open and start playing with it! also try jumping into an irc channel and picking some brains, I know the codenameandroid irc is usually quite helpful and noob friendly.

Be sure to make a back up, have a good knowledge of recovery, android debugging bridge, and how to push image files to your phone if need be ( if you're just building themes it shouldn't come to this but its good too know just in case ). Most likely the worst thing you're going to encounter is boot-loop but if the crap really hits the fan you'll know how to get out of it.

P.s Remember if you compile directly from Google source you will over write you're recovery back to factory and lose root access. make sure and open your rom.zip ( the one you created from source ) and delete the recovery from it before you flash. This should only apply too Google source as most all 3rd party developers have already removed the factory recovery and added root permission with superuser.apk baked in. Good luck on your journey and happy trails, perhaps ill be chatting with you in an Irc channel someday
Image
.
 
#35 ·
I keep getting stuck on:

* [new tag] android-sdk-4.0.3-tools_r1 -> android-sdk-4.0.3-tools_r1
* [new tag] android-sdk-4.0.3_r1 -> android-sdk-4.0.3_r1
* [new tag] android-sdk-adt_r16.0.1 -> android-sdk-adt_r16.0.1

error: Exited sync due to fetch errors

Any ideas on how to fix? Saw it mentioned before, but fix wasn't explained.

Thanks for write up, very helpful.
 
#36 ·
I keep getting stuck on:

* [new tag] android-sdk-4.0.3-tools_r1 -> android-sdk-4.0.3-tools_r1
* [new tag] android-sdk-4.0.3_r1 -> android-sdk-4.0.3_r1
* [new tag] android-sdk-adt_r16.0.1 -> android-sdk-adt_r16.0.1

error: Exited sync due to fetch errors

Any ideas on how to fix? Saw it mentioned before, but fix wasn't explained.

Thanks for write up, very helpful.
I assume you've tried multiple times. I've had that error many times, usually due to either 1) something causing a drop in my internet connection or 2) github have issues. They always resolved after doing another repo sync (or two or three). Have you tried deleting the folder and starting over?
 
Status
Not open for further replies.
You have insufficient privileges to reply here.