103

When I run my android app from eclipse, I get this error.

Unexpected exception 'Cannot run program "/home/antz/Development/adt-bundle-linux/sdk/platform-tools/adb": error=2 No such file or directory' while attempting to get adb version from /home/antz/Development/adt-bundle-linux/sdk/platform-tools/adb

COPY PASTE FROM Eclipse Error

[2012-11-26 13:43:08 - adb] Unexpected exception 'Cannot run program "/home/antz/Development/adt-bundle-linux/sdk/platform-tools/adb": error=2, No such file or directory' while attempting to get adb version from '/home/antz/Development/adt-bundle-linux/sdk/platform-tools/adb'

However my adb is exactly in the location where it says it's not.

What is wrong and how do I fix this?

I cd into the directory where adb is (/home/antz/Development/adt-bundle-linux/sdk/platform-tools/) and I typed in adb and it says

antz@antz-90X3A:~/Development/adt-bundle-linux/sdk/platform-tools$ ls  
aapt  aidl  dexdump  fastboot  llvm-rs-cc  renderscript  
adb   api   dx       lib       NOTICE.txt  source.properties  
antz@antz-90X3A:~/Development/adt-bundle-linux/sdk/platform-tools$ adb  
bash: /home/antz/Development/adt-bundle-linux/sdk/platform-tools/adb: No such file or directory

adb is green which means its an executable, correct?

for example, dx is also green and when I typed in dx into the command prompt, it works... whats wrong with adb?

Joseph Erickson
  • 2,304
  • 20
  • 29
ealeon
  • 12,074
  • 24
  • 92
  • 173

20 Answers20

143

On Linux, Android SDK platform-tools package containing adb used to be 32bit. It worked fine on 32bit systems. But on 64bit systems you need to manually install the IA32 library.

For Debian based distributions try this:

sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5

But since v24.0 platform-tools contains only 64bit binaries - so 32bit libraries no longer required.

Alex P.
  • 30,437
  • 17
  • 118
  • 169
Robin Chander
  • 7,225
  • 3
  • 28
  • 42
  • thanks this made it work. why didnt they include this step into the tutorial? – ealeon Nov 26 '12 at 19:17
  • 4
    Google did provide the information. See http://developer.android.com/sdk/installing/index.html Click on Information for other platforms and then troubleshooting ubuntu. – Robin Chander Nov 26 '12 at 19:22
  • yeah i was following that website. but i didnt go into troubleshooting ubuntu. anyways thanks! – ealeon Nov 26 '12 at 19:37
  • 5
    @RobinChander, funny that the [Linux 64-bit ADT bundle](http://developer.android.com/sdk/index.html) comes with a 32 Bit adb under `adt-bundle-linux/sdk/platform-tools/adb` ... This is also a problem under other distributions, e.g. Fedora 17. – maxschlepzig Dec 07 '12 at 09:57
  • 6
    I cannot install IA32 libs! Why? – gtr123 Dec 24 '12 at 18:01
  • 1
    I got the same error and then I did apt-get install ia32-libs but now how do I restart the configuration of the ADT tools in eclipse? I am running Ubuntu 12.04 – CodeKingPlusPlus Jan 20 '13 at 15:51
  • @ afterimagedesign. Proceed the statement with Sudo to perform the activity as a super user if you can. To do so you will need a super user password. – Andrew S Jul 23 '13 at 21:24
  • Saved my computer from going out a window. Ubuntu 12.04LTS – nwnoga Feb 11 '14 at 19:23
112

You can no longer install ia32-libs, so you must the individual 32 bit libraries needed by adb

sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5

And for Ubuntu 13.10:

sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1
ffurrer
  • 105
  • 7
ekun
  • 1,121
  • 1
  • 7
  • 2
  • Is this referring to a specific version of Linux? If so, could you put it in your answer. – CatShoes Jun 13 '13 at 16:31
  • Note: if installation fails (bad dependences) try installing it throw the aptitude. It would suggest you to downgrade some of librares so the installation will success. – Ben Usman Aug 14 '13 at 09:52
  • 4
    I also needed to install lib32z1 (Ubuntu 13.10) – AntonS Nov 23 '13 at 17:11
  • E: Package 'lib32stdc++6' has no installation candidate E: Package 'lib32gcc1' has no installation candidate E: Unable to locate package lib32ncurses5 – digit plumber Dec 10 '13 at 05:11
  • Yeah Thanks alot :) Workks great on ubuntu 13.10 – Aukhan Jan 28 '14 at 12:35
  • Worked fine on Debian Jessie. – Justin Skiles Feb 14 '14 at 01:16
  • On my Ubuntu 14.04 64 bit machine, the first command worked. A dependency lib32tinfo5 was also installed automatically. I had tried the second command(the one for Ubuntu 13.10) initially, but it did not work because lib32z1 was not found. – faizal May 11 '14 at 09:00
  • getting error in for 13.04 E: Unable to locate package lib32stdc++6 E: Couldn't find any package by regex 'lib32stdc++6' E: Unable to locate package lib32gcc1 E: Unable to locate package lib32ncurses5 E: Unable to locate package lib32z1 – LOG_TAG Jan 14 '15 at 08:06
30

You have to install the 32 bit glibc:

in Fedore 64 bit machine

# yum install glibc.i686

This removes the misleading 'no such file or directory' message when trying to execute a 32 bit binary. With that the 64 bit Fedora system is capable of executing 64 bit binaries.

This also removes the misleading 'not a dynamic executable' message of ldd when calling ldd on a 32 bit dynamic executable.

Now you have to install missing 32 bit libraries the binaries under adt-bundle-linux/sdk/platform-tools are linked against:

# yum install zlib.i686 libstdc++.i686 ncurses-libs.i686 libgcc.i686

Thats it.

yokks
  • 5,683
  • 9
  • 41
  • 48
24

I'm using Ubuntu 14.04 LTS 64-bit and the following code works for me;

sudo apt-get install lib32z1 lib32z1-dev
sudo apt-get install lib32stdc++6


Summary:

After I tried apt-get install ia32-libs, but apt package tool suggest that;

Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source.

However the following packages replace it:
  lib32z1 lib32ncurses5 lib32bz2-1.0

Then the above code works for me.

Community
  • 1
  • 1
gihanchanuka
  • 4,783
  • 2
  • 32
  • 32
9

This works great in Ubuntu 13.04 64bit version

You can no longer install ia32-libs, so you must the individual 32 bit libraries needed by adb

sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5
Gihan De Silva
  • 458
  • 8
  • 17
GothamNite
  • 101
  • 1
  • 5
8

On Arch linux:

Enable the "multiarch" repositories in /etc/pacman.conf

then run:

root@box#pacman -Syu

root@box#pacman -S lib32-glibc lib32-zlib lib32-libstdc++5 lib32-ncurses lib32-gcc-libs
Naumdev
  • 187
  • 1
  • 9
4

I am running Ubuntu 12.04 LTS and this command is the only thing that worked for me:

sudo apt-get install lib32z1 lib32z1-dev

Once I ran that from a command line, I was able to get the R.java file to generate (the tell-tale sign that something in your Android SDK tools installation is not quite right) by doing a Project > Clean in Eclipse.

J Steven Perry
  • 1,711
  • 1
  • 17
  • 28
3

On Fedora 17 or 18:

sudo yum install redhat-lsb.i686
Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
xwindows
  • 31
  • 1
3

For multiarch Debian 7.0, add:

dpkg --add-architecture i386
apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
XXX
  • 31
  • 1
2

You need to install the ia32-libs (IA32 libraries) package for this to work.

2

I did it in my Linux Mint 12:

   chmod +x PATH/adb
Cleórbete
  • 21
  • 1
2

if you're having this problem in 64bits, try this (worked for me):

$ apt-get install lib32gcc1 libc6-i386 lib32z1 lib32stdc++6
$ apt-get install lib32ncurses5 lib32gomp1 lib32z1-dev lib32bz2-dev
$ apt-get install g++-multilib

http://sixarm.com/about/ubuntu-apt-get-install-ia32-for-32-bit-on-64-bit.html

victorkurauchi
  • 1,390
  • 18
  • 23
2

From the Ubuntu Multiarch HOWTO:

Some users using the Android SDK might encounter problems when trying to run build-tools or platform-tools on amd64 bit platform. As replacement for ia32-libs, users should be fine just installing the following libraries:

dpkg --add-architecture i386
aptitude update
aptitude install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
bonh
  • 2,863
  • 2
  • 33
  • 37
1

Install these libraries in linux apt-get install ia32-libs

Khumzzz
  • 29
  • 1
1

Run these commands below. Its worked for me

sudo apt-get dist-upgrade
sudo apt-get install ia32-libs
Johannes Stadler
  • 737
  • 12
  • 24
hemanth reddy
  • 35
  • 1
  • 9
1

in ubuntu 64 bits [12.04]-[14.10] and Elementary OS 64 bits

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
David Hackro
  • 3,652
  • 6
  • 41
  • 61
1

Sometimes it's just a matter giving sdk files the necessary permissions.

sudo chmod -R +x /path/to/android-sdk-linux

Restart Android Studio and see if that fix it.

Permission issues typically occur when you copy/move sdk files from a NTFS partition or copying from another computer.

Gayan Weerakutti
  • 11,904
  • 2
  • 71
  • 68
1

sudo apt install adb

adb not installed in your pc

Try this.

Gautam
  • 1,345
  • 12
  • 30
0

http://abhinavasblog.blogspot.sg/2013/10/working-with-ubuntu-1304-and-1310-java.html

the blog explain resolution to Ubuntu 13.10 for installing Chrome, Java and Fixing Android SDK.

Abhinava
  • 1,030
  • 9
  • 19
  • Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. Just for the future, the answer is already given. [See this meta article.](http://meta.stackoverflow.com/help/how-to-answer) – Johannes Stadler Apr 12 '14 at 20:07
0

The correct current combo for Arch Linux is as follows: :

[This part is unchanged] Uncomment the following section in /etc/pacman.conf:

...
[multilib]
Include = /etc/pacman.d/mirrorlist
...

Then:

sudo pacman -Syu && sudo pacman -S multilib/lib32-libstdc++5 multilib/lib32-zlib

The difference with the other answer is that package names include the multilib/ part now.

(from Arch Wiki: Multilib#Enabling, Android#Troubleshooting)

Ivan Bartsov
  • 19,664
  • 7
  • 61
  • 59