My Wiki!

Developing Android App on 64-bit system

Download packages

Download and extract android sdk and ndk from android website.

Install ADT in Eclipse

install ADT.

Issue: aapt not found

Quick Tips: Fedora x86_64 and Android ADT issues! Elmo Recio Monday August 29, 2011 01:00 AM In this weeks' quick tips, Elmo takes us through resolving some issues with compiling Android ADT on Fedora 64-bit.

So I updated my Android ADT plugin for Eclipse to version 10. I am running on a fully x86_64 system, but installed just the libraries I needed to run the Android SDK. In any case, I ran into a problem with the Fedora 13 zlib 32-bit package. Whenever I would run the “aapt” or try to compile anything from within Eclipse, I would get the following error:

/opt/android-sdk-linuxx86/platform-tools/aapt: /lib/libz.so.1: no version information available (required by /opt/android-sdk-linuxx86/platform-tools/aapt)

To resolve this issue, I had to download the latest zlib source code and compile it from scratch as a 32-bit application. HOWEVER, I did not install it over the zlib located in /usr/lib. I didn't want to mess anything else that would be using that library - or have it clobbered after a yum update. Instead I installed it into the platform-tools directory in the android sdk directory.

In detail:

1) Installed the 32-bit stubs header files. This allows me to cross compile using 32-bit libraries: glibc-devel-2.12.2-1.i686

yum -y install glibc-devel-2.12.2-1.i686

2) Downloaded zlib from their website: http://www.zlib.net/

wget http://zlib.net/zlib-1.2.5.tar.gz

3) Uncompressed the file and ran configure

tar -xzf zlib-1.2.5.tar.gz

cd zlib-1.2.5

./configure

4) Edited the resulting Makefile , replacing “-m64” with “-m32”

cat Makefile | sed -e 's/-m64/-m32/g' > Makefile.32

5) Ran make with that file

make -f Makefile.32

6) Hard linked the resulting libz.* to the android platform tools directory. (Hard link in case a future Android update clobbers that directory, I don't have to recompile libz.) In this case, I have my Android SDK files in /opt, replace as needed.

ln libz.* /opt/android-sdk-linux_x86/platform-tools/

Now all my applications compile correctly for the Android.

So I noticed that I had to write a wrapper script which preloaded libz from the installed directory versus the system libz. Just rename aapt to aapt.bin, and create a new file called aapt. Call the aapt.bin file using the LD_PRELOAD environment variable pointing to the new libz, passing all the command line arguments to the aapt.bin file. Make aapt shell script executable, and everything should load OK.

For example the following commands should work:

$ mv aapt aapt.bin

$ touch aapt

$ chmod 755 aapt

$ cat «EOF

>aapt

#!/bin/bash

Loads the libz library from the current directory.

libz 32bit library differs from system's libz

LDPRELOAD=/opt/android-sdk-linuxx86/platform-tools/libz.so /opt/android-sdk-linux_x86/platform-tools/aapt.bin $@

EOF

Issue: Eclipse can't start Emulator

Compile application in eclipse and install app to Emulator Device using console.

cd <path to project>
adb install bin/HelloFed.apk

Or Specify virtual device to install.

adb -s emulator-5554 install path/to/your/app.apk

See also


Navigation
Toolbox