Saturday, January 7, 2012

Getting Android SDK to work on Ubuntu 11.10 64bit

Getting the Android SDK to work on Ubuntu 11.10 64bit turned out to be rather easy. Here's my story...

Black Friday found me standing in a long line in the early hours of the morning waiting for the store to open so I could finally get a laptop that was powerful enough to do both my writing and my Android development. I ended up with a Sony VAIO and it's been great! While Windows 7 is a nice operating system, I also want Ubuntu Linux on this thing too.

Once I found the time to do the disk partitioning (Windows 7 makes this easy with a disk shrink option in the Administrative Tools), and to install Ubuntu (I got 11.10), I then had to install the Java JDK (OpenJDK), Eclipse, Android SDK and the ADT. And eventually I got a nasty message telling me that the libncurses.so.5 library was not good. In fact, it wasn't even present.

The program that was having the problem was 'adb' which is located in the platform-tools directory. Using the following I was able to realize that the libncurses library was in fact missing:

ldd $HOME/android-sdk-linux/platform-tools/adb

What to do? Well, it turns out there's a very nice package of 32bit libraries that can be installed onto a 64bit system to clear up these sorts of problems. So this is what I did next:

sudo apt-get install ia32-libs

This installed quite a few libraries but most importantly it installed a libncurses library. Now I get this result:

ldd adb
    linux-gate.so.1 =>  (0xf7780000)
    librt.so.1 => /lib32/librt.so.1 (0xf7758000)
    libncurses.so.5 => /lib32/libncurses.so.5 (0xf7736000)
    libpthread.so.0 => /lib32/libpthread.so.0 (0xf771a000)
    libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf762f000)
    libm.so.6 => /lib32/libm.so.6 (0xf7605000)
    libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf75e7000)
    libc.so.6 => /lib32/libc.so.6 (0xf746d000)
    libtinfo.so.5 => /lib32/libtinfo.so.5 (0xf744d000)
    /lib/ld-linux.so.2 (0xf7781000)

Now that's more like it. No more error messages and everything appears to be working great!