25

When I compile an android application ( I tried with the sample ones from the sdk). I get this error:

>Error executing aapt: Cannot run program "/home/roel/projects/sdk/build-tools/18.0.1/aapt": >error=2, No such file or directory: error=2, No such file or directory    KeyChainDemo        >line 1 Android ADT Problem

But aapt is at that location?

>[roel@archUSB 18.0.1]$ ls /home/roel/projects/sdk/build-tools/18.0.1/

>NOTICE.txt  aidl     dx   libLLVM.so  libbcinfo.so  llvm-rs-cc    source.properties
>**aapt**        dexdump  lib  libbcc.so   libclang.so   renderscript

Note: I also get the error "R cannot be resolved", but I'm pretty sure that when I solve problem 1, I also solve this problem

1

8 Answers 8

67

Ubuntu 14.04.1 LTS solution:

sudo apt-get update 
sudo apt-get install gcc-multilib lib32z1 lib32stdc++6

Reason: aapt needs 32-bit libraries installed

Sign up to request clarification or add additional context in comments.

4 Comments

Unable to locate package
Just comment the reason, aapt need 32 bit libs installed
Even a better solution than the Google proposed one
What a horribly useless error message! Shame on the dev(s) who wrote that!
21

The problem was my 64bit OS , I missed some 32 bit libs ;)

7 Comments

I'm having the same issue... on Ubuntu 13.04 64bits. What libs did you install?
@h_rules: apt-get install ia32-libs as instructed at developer.android.com/sdk/installing/index.html (see "Troubleshooting Ubuntu")
On Ubuntu 14.04 ia32-libs is deprecated so I had to install lib32z1 and lib32stdc++6
Why is your sudden discovery marked as an answer? :D
I think the answer by Benjamin deserves to be marked as the accepted answer. Can you please accept that.
|
20

SDK tools 24 has a bug, build will fail with the same error. Should be fixed in the new version, for now the workaround in tools/ant/build.xml place

<property name="aapt" location="${sdk.dir}/build-tools/22.0.1/aapt" />
<property name="aidl" location="${sdk.dir}/build-tools/22.0.1/aidl" />
<property name="dx" location="${sdk.dir}/build-tools/22.0.1/dx" />
<property name="zipalign" location="${sdk.dir}/build-tools/22.0.1/zipalign" />

at the end of the xml in the root tag. Replace 22.0.1 with your build tools version

3 Comments

Life saviour is here guys
You really helped me.
Or can just specify executable= in his build.xml without the dir= statement.
7

Debian 7 Wheezy solution:

sudo dpkg --add-architecture i386
sudo apt-get update 
sudo apt-get install ia32-libs

Comments

7

Ubuntu 13.10 solution:

Append

deb http://archive.ubuntu.com/ubuntu/ raring main restricted universe multiverse 

to /etc/apt/sources.list.

sudo apt-get update
sudo apt-get install ia32-libs

Comments

2

I had this same problem today. If anyone from the future is having this problem, try the solution here

Programs running aapt in android sdk from shell and from sbt

Comments

2

I had the same problem today, this helped me.

Arch Linux 64bit.

Comments

1

aapt is a 32 bit application and will fail on a 64 bit box until 32 bits are enabled and libs added

This is current solution as of Ubuntu 16.04 / 17.10

dpkg --print-foreign-architectures  #  if below was never run this returns nothing ... afterwards it will return : i386
sudo dpkg --add-architecture i386
sudo apt-get -qqy update
sudo apt-get -qqy install libncurses5:i386 libstdc++6:i386 zlib1g:i386

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.