Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Cannot run aapt

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

like image 443
user1104939 Avatar asked Aug 04 '13 10:08

user1104939


3 Answers

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

like image 81
Benjamin Avatar answered Nov 14 '22 23:11

Benjamin


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

like image 33
user1104939 Avatar answered Nov 14 '22 21:11

user1104939


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

like image 20
eviltnan Avatar answered Nov 14 '22 23:11

eviltnan