Building, Installing, Configuring The Android Platform and Android SDK on Ubuntu 9.10 64-bit x86

November 11th, 2009 | by Ozgur Cem Sen |

Android SDK LogoUbuntu Logo

This post is about my battle of building, installing and configuring the Android Platform and the Android SDK on Ubuntu 9.10 64-bit x86. Insult to the injury, all that is happening in a VirtualBox VM on a Mac running Snow Leopard.

Please remember, this is NOT intended to be a step by step instruction manual. RTFM ;)

Follow the regular installation instructions and possibly throw in the following in the mix, when and if you have to.

You will need the Android Source to build (doh!). Here.

Obstacle #1. No Java 1.5.0 in Ubuntu 9.10. Gotta have it, otherwise Android “make” barely bothers to launch.

http://java.sun.com/javase/downloads/index_jdk5.jsp is a starting point. I grabbed the rpm build.

Assuming you have the “rpm” (otherwise apt-get install rpm), install the downloaded package. –force-debian –nodeps flags may be required.

Now you have Java 1.5.0 in place, you need to setup your environment properly.

1
sudo update-alternatives --install /usr/bin/java java /usr/java/jdk1.5.0_22/bin/java 50
1
sudo update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.5.0_22/bin/javac 50

** change your jdk1.5.0 path if necessary

Getting close.

The “apt-get install” in the documentation http://source.android.com/download includes “sun-java5-jdk“, so take it out and run the command as follows:

1
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev

Try the “make” now.

Next is installing the Android SDK on Ubuntu 9.10. Grab it at http://developer.android.com . Unzip, move it around etc.

Starting with Android SDK r3, you need to pick and choose what you want to download and install. “./android” under the “tools” directory does that for you. However, every single time I tried this on my Macs, I got the “You might want to force download through HTTP in the settings.” error. So be it, go the the options, simply check the “Force https://… sources to be fetched using http://…” option and download happily ever after. This was a no-go in my Ubuntu 9.10. The trick to properly enable and utilize that checkbox is to run:

1
export GDK_NATIVE_WINDOWS=true

Now, you should be able to download the SDK without the https:// mallarky.

After all this, hopefully, you should be Android’ing in your Ubuntu box in no time ;)

Good luck.

  1. 7 Responses to “Building, Installing, Configuring The Android Platform and Android SDK on Ubuntu 9.10 64-bit x86”

  2. By denkai on Nov 26, 2009 | Reply

    nice article, but a how to would of been nice lol.

  3. By Ozgur Cem Sen on Nov 27, 2009 | Reply

    “Please remember, this is NOT intended to be a step by step instruction manual. ” LOL

  4. By moritz on Nov 29, 2009 | Reply

    yeah, i’m just starting to build the platform on the exact same configuration here — so thanks a lot!

  5. By moritz on Nov 29, 2009 | Reply

    btw, by simply adding the karmic repo in ubuntus sources.list, installing the jdk is quite straightforward ( and free of side effects )

  6. By Hijaszu on Mar 24, 2010 | Reply

    This is very far from building, installing and configuring android platform. Most of your post, except java struggling can be found on the official android platform. As for your java struggling, try this instead hacking (before starting the build):

    export PATH=/usr/lib/jvm/java–sun-/bin:$PATH

    .

  7. By Hijaszu on Mar 24, 2010 | Reply

    export PATH=/usr/lib/jvm/java-<desired_version>-sun-<version>/bin:$PATH

  8. By Ozgur Cem Sen on Apr 25, 2010 | Reply

    That’s what I say somewhere in the post :) just a few tips and tricks.

Post a Comment