Compiling Android Froyo on Ubuntu 10.10

As I follow the steps by steps guide on source.android.com, but turns out the information there are outdated. I here add in more information. Hope this helps everyone getting through the compiling process.

Major point: Froyo needs to be compiled under 64bit!! There is method to do it in 32bit, use it at your own risk. Tips Link

On the android page, they said needed JDK5.0 but not Java 6. But for Froyo, JDK 6 is expected. So just skipped installing JDK 5. To install JDK6 on Ubuntu. The Ubuntu Software Center just giving me error message. So better to use terminal to do it.

Prerequisite Libraries

A side notes:

apt-cache search jdk

This helps me to identify which are the JDK available on Ubuntu. Because I keep misspell the exact name. I thought it is sun-java6-jdk. Anyway, the correct one is:

sudo apt-get install openjdk-6-jdk

 

So after installing, add the JAVA_HOME and ANDROID_JAVA_HOME at end of line of ~/.bashrc

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
export ANDROID_JAVA_HOME=$JAVA_HOME

 

The complete updated libraries and dependencies will be:

sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev

Total size estimate to be around 240MB.

After that follow the source.android.com to create repo and sync your repo. Froyo master branch is around 3~4GB.

After your repo init and sync, all the latest code from android should be ready. Next steps, make!

make –j4

* -j2 or –j4 means the threads use for make.

During Building

I’m getting several compilation error issues, after resolving all, here are the libraries that missed out from the page.

sudo apt-get install libc6-dev-i386 g++-multilib lib32z1-dev lib32ncurses5-dev libx11-dev

After complete building, you should have 3 important img files inside out/target/product/generic/ folder.

 

Update Notes:
I just notice The openJDK I installed earlier isn’t the same as JDK from SUN, however my compilation will still work. JAVA 1.6 JDK is back to Ubuntu 10.10 by this method link.