Getting Android SDK working on Ubuntu 64

Johan Haleby

Today I was trying to setup the Android SDK (version 1.6_r1) on the 64 bit version of Ubuntu 9.04 (Jaunty Jackalope). After having installed the ADT Eclipse plugin and pointed out the Android SDK directory in the settings I immediately ran into the following error:

Failed to get the adb version: Cannot run program "/home/johan/devtools/android/android-sdk-linux_x86-1.6_r1/tools/adb": java.io.IOException: error=2, No such file or directory

I opened the terminal and tried to manually run an Android executable but even here it said that the file couldn't be found! The problem seemed to be that the Android executables requires 32 bit libraries that are not available in Ubuntu 64 by default. To solve this I downloaded the execellent getlibs application which is a utility for automatically resolving dependencies for 32-bit programs on a 64 bit system. So I went into platforms/android-1.6/tools in the Android SDK installation folder and executed:

 
getlibs aapt
 

which installed and upgraded the following libraries:

 
The following NEW packages will be installed:
  ia32-libs lib32asound2 lib32gcc1 lib32ncurses5 lib32stdc++6 lib32z1
  libc6-i386
The following packages will be upgraded:
  libc6 libc6-dev
 

After this was done I went back into Eclipse, did a project clean and refresh and after that I was able to start the Android emulator successfully. Hopefully this may help someone who's in the same situation.

Johan Haleby
Consultant at Jayway

Tags: , , ,

41 comments ↓

#1 kevin on 11.08.09 at 5:57

Ran into the same problem!! How did you figure out it was 32-bit issues? Here’s the strange thing.. about a month or so ago I installed the jdk 1.6 from sun, eclipse 3.4 and the ADT plugin, prior to 1.6 being out. It all ran just fine on ubuntu 6.04 64-bit back then. So I was pulling my hair out today trying to figure out why the heck it wouldn’t work. So how did you find out it was some 32-bit issue, and is this something new in 1.6 or 2.0.. cause I know I didn’t have this issue before.

BTW.. it now works.. thank you very much! I’ve bookmarked this thread to share with others. Keep it up for a while.

#2 Johan Haleby on 11.08.09 at 8:29

Hi,

I’m glad that my blog could help you since I had to spend lots of time figuring this out (it’s not obvious that your missing 32bit libraries to say the least). I found the solution by loads of googling and trying out many different solutions in a sort of trial and error approach.

I’ve only used version 1.6 so I cannot say anything about the other versions. Did you run into this problem with 2.0 as well?

/Johan

#3 Sakti on 05.24.10 at 8:03

thanks, now i have idea to solve my problem

#4 ncorpse on 07.24.10 at 17:24

Hi
Thanks alot. Because of your blogpost, I just googled found this and had it working in 5 minutes.

#5 Sefy on 09.09.10 at 11:51

Thanks a lot, just solved my problem.

#6 Failed to get the adb version: Cannot run program. - Android Forums on 10.10.10 at 22:02

[...] you running 64 bit Linux? If so use getlibs – see here for a description of the problem. Type "getlibs adb" rather than aapt as [...]

#7 Felix on 10.16.10 at 11:39

thank you!

#8 Natanael L on 10.30.10 at 16:04

Hi. When I run adb on my 64 bit computer, adb devices says this:

$ ./adb devices
List of devices attached
???????????? no permissions

Same thing when I run it with sudo. The phone is a Samsung Galaxy Spica. What can I do? On 32 bit Ubuntu I’ve had to use a patched adb since the original didn’t even recognize the phone.
What can I do?

#9 Ming on 11.03.10 at 10:25

Thanks for the pointer. For a few minutes I thought I was in the twilight zone not being able to execute ‘adb’ not matter how I tried.

#10 Zaidceb on 11.15.10 at 16:06

Well I have the same kinda problem
I am working on the Ultimmate Edition 2.6 64 bit and have the new Android sdk which also includes the android 2.2 platform along with the older 1s..
Am not able to add android libraries to the eclipse galileo…
It gives the following error at console:
[2010-11-15 20:31:36 - PackageName] Unable to resolve target ‘android-8′

Please help….

#11 Oscar on 11.22.10 at 7:46

Hey, thank you so much!!

#12 Thomas on 12.12.10 at 4:14

Thank you so much. You just maid my day.

#13 Ade Goodyyer on 12.26.10 at 23:40

Cheers buddy, managed to get this sorted after so long of trying!!

Thanks again,

All the best,

Ade

#14 erdosjiang on 01.05.11 at 16:38

I think this is a problem about jre
I try it like this:
first,i copy a 32bit version jre from my friend’s computer and put it into ~/jre

than,open a console window
export PATH=$PATH:/home/erdosjiang/jre/bin
cd /tools
./adb devices
it’s ok…

eh,,,my English is so bad,can you understand me?you can send me a email to erdosjiang@gmail.com, if you want to help me to practice my English,haha,i can teach you some Chinese too.

For “Natanael L”,you can do like this:
adb kill-server
sudo adb start-server
adb devices

you should run adb start-server with sudo

#15 Albie on 01.20.11 at 14:03

Hi,
Thanks a lot for te explanation.
Does anybody know if this procedure work on Macs?
I just want to take some screenshots of an Android application. …I don’t know anything about these things.
Can anybody help?

#16 Chandan on 02.25.11 at 12:46

Hey Johan,

Thank you very much for sharing the info..

I struggled a lot before reaching this site. and now..i can rock with Android on Ubuntu :-)

Regards,
Chandan

#17 Bruce on 03.15.11 at 7:11

Thanks you.
Ubuntu 10.10 require the solution too.

#18 Sumanth on 03.23.11 at 7:31

Thanks a lot. I was trying random fixes before reaching your site.

#19 Prasad on 04.22.11 at 14:50

Thanks man. You saved my day.

#20 Scott on 05.27.11 at 23:41

Awesome.

Worked on LMDE (Linux Mint Debian) 64 bit.

Cheers! :D

#21 Jon on 05.29.11 at 20:02

I’m running Ubuntu 11.04 – 64-bit and had no problems running the emulator.

However, when I exit the simulator (via closing the window) – the emulator freezes every time.

I’m tried running the -noaudio flag as suggested from different sources, but no luck. Any assistance please :) .

#22 hamilton baker on 05.31.11 at 22:34

Thank you so much ! I spend 2 hours trying to get this figured out till I found your site.

#23 Onio on 06.01.11 at 15:52

Ran into the same problem and it worked for me. Thank you.

#24 Seb on 06.02.11 at 11:41

Thank you very much, you solved my problem in 5 minutes !

#25 joe on 06.20.11 at 20:52

Thank you very much! This method really work!!!

BTW, this problem made me reinstall everything more than 3 times….

#26 Kangqi on 07.12.11 at 10:37

Thanks, I like your blog…

#27 我期待!!! » Blog Archive » — on 07.13.11 at 10:53

[...] http://blog.jayway.com/2009/10/21/getting-android-sdk-working-on-ubuntu-64/ [...]

#28 Me on 08.16.11 at 20:28

You, sir, are awesome! I would never have figured this out on my own :)

#29 M G on 08.19.11 at 20:53

Thanks a lot Jay! You saved me a lot of trouble. Should ‘ve figured it out though since the tools are named android….-x86….

#30 che3ver on 09.11.11 at 8:26

Thank you for posting this. You saved me a great deal of time.

#31 britneykilla on 09.18.11 at 20:04

Thanks a lot!

#32 Jordi on 09.28.11 at 2:06

Thank you very much!!!!!! That did the trick!

#33 TABTRONICS – 7″ M009S 2GB Google Android 2.2 Tablet PC - - buyatablet.org | buyatablet.org on 10.08.11 at 3:43

[...] Flash 10.1 – WiFi , Touchscreen, Epad, Apad, now with working Android Market, Youtube – FREE Pouch.This 7" Tablet comes with Android 2.2 and can can now access the Google Android Market (UK). With Fl… Memory 256MB DDR2 Storage Device 2GB NAND Flash maximum capacity of 32GB tf card Gravity [...]

#34 Problem while installing Android SDK in Eclipse 64bit | muthumanict on 10.11.11 at 7:16

[...] http://blog.jayway.com/2009/10/21/getting-android-sdk-working-on-ubuntu-64/ Share this:TwitterFacebookLike this:LikeBe the first to like this post. This entry was posted in Android by muthumanict. Bookmark the permalink. [...]

#35 Srini on 10.28.11 at 2:50

Thanks a lot for your hard work in finding and solving this problem for the rest of the world

#36 Setiawan on 10.30.11 at 2:36

Thanks for the post. Never had problem with previous version of Kubuntu, but when i upgrade to oneiric this issue just comes up.

#37 Shwetank on 12.01.11 at 15:08

Thanks a ton.

Been looking for this.

#38 ozh on 12.30.11 at 7:47

man!! thanks a lot!!

#39 Hudson Souza on 01.10.12 at 1:59

Thanks a lot. It realy solved my problem on a Ubuntu 11.10 64 bits

#40 rick on 01.19.12 at 4:51

YES! Actually, I didn’t need to use getlib. All I needed to do was get ia32-lib through synaptic; most of the libs you list as detected by getlib were installed as dependencies. YMMV

#41 NuShrike on 01.22.12 at 2:54

For Xubuntu 64 (about same as Ubuntu 64) 11.10, it’s still:
* install ia32-libs (not the multi-arch version)
* install 64-bit Eclipse (Indigo) from Synaptic or Ubuntu Software Center; this will install 64-bit openjdk-6
* enable Helios repo in Eclipse (not Indigo)
* install ADT (and rest of developer.android.com’s instructions for this segment)
* restart Eclipse, point at SDK, and voila.

Leave a Comment