Tuesday, August 6, 2013

Error executing aapt within eclipse

Although the Android Development Tools (ADT) bundle is available as a zip package for 'Linux 64 Bit' it states following requirements:
64-bit distributions must be capable of running 32-bit applications.
And indeed, just running the packaged eclipse on a Fedora 19 64 bit system results in errors, because it can't 'find' several development tools, e.g. adb or aapt:
Error executing aapt: Cannot run program "/home/juser/local/adt-bundle-linux/sdk/build-tools/android-4.3/aapt": error=2, No such file or directory: error=2, No such file or directory
The 'no such file' is misleading because it is there (under $HOME/local):

adt-bundle-linux/sdk/build-tools/aapt
 
Looking at the file

$ file adt-bundle-linux/sdk/platform-tools/aapt
adt-bundle-linux/sdk/platform-tools/aapt: ELF 32-bit LSB executable, Intel 80386,
 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8,
 not stripped 
 
You have to install the 32 bit glibc:

# 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 
 
 
http://unix.stackexchange.com/questions/57863/how-to-run-32-bit-programs-on-64-bit-fedora-17