file not found, but the file is there

2

1

running an Ubuntu 14.04 x64, I like to execute an binary file. This one:

$ ls -la /opt/android-sdk-linux/tools/emulator
-rwxrwxr-x 1 tho tho 35640 Nov 19 14:46 /opt/android-sdk-linux/tools/emulator

If I run the executable as user tho, the following file not found error occours:

$ /opt/android-sdk-linux/tools/emulator
bash: /opt/android-sdk-linux/tools/emulator:  no such file or directory

I tried the following commands:

$ file /opt/android-sdk-linux/tools/emulator
/opt/android-sdk-linux/tools/emulator: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

readelf -l emulator returned without any errors.

ldd emulator says, that this program is not dynamically linked

$ strace  /opt/android-sdk-linux/tools/emulator
execve("/opt/android-sdk-linux/tools/emulator", ["/opt/android-sdk-linux/tools/emu"...], [/* 64 vars */]) = -1 ENOENT (No such file or directory)
write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
exit_group(1)                           = ?
+++ exited with 1 +++

What could be the reason for that error?

The Bndr

Posted 2014-11-20T09:22:53.313

Reputation: 133

Answers

2

You're running 64-bit Linux, but the Android SDK tools are 32-bit. At the same time, you don't have the 32-bit compatibility libraries installed on your system.

So you just need to install those:

sudo apt-get install ia32-libs

Michael Hampton

Posted 2014-11-20T09:22:53.313

Reputation: 11 744

apt-get returned the information, that ia32-libs is not available, but it's replaced by lib32z1 lib32ncurses5 lib32bz2-1.0 -> installing those packages will solve that problem. Thank you!! – The Bndr – 2014-11-20T09:53:44.947

Glad this got resolved but I'm curious why bash would say emulator: no such file or directory? The file emulator exists, shouldn't it give an error about dependencies or have the executable itself throw an error? – baochan – 2014-11-20T19:46:13.233