37

Hi I am having trouble compiling, I get this error:

Gradle: Execution failed for task ':ElectronicComponentInventorySearch:mergeDebugResources'.

java.io.IOException: Cannot run program "/opt/android-studio/sdk/build-tools/android- 4.2.2/aapt": error=2, No such file or directory

When I use locate: /opt/android-studio/sdk/build-tools/android-4.2.2/aapt

Before I tried anything I made sure to chown the whole android-studio directory to my account and set permissions for everything to 775.

Whats up?

Clayton
  • 381
  • 4
  • 13
omegacore
  • 1,712
  • 2
  • 12
  • 16
  • possible duplicate of [Android's aapt not running on 64-bit Ubuntu 13.10 (no ia32-libs). How can I fix this?](http://stackoverflow.com/questions/19523502/androids-aapt-not-running-on-64-bit-ubuntu-13-10-no-ia32-libs-how-can-i-fix) – Clayton Apr 29 '14 at 18:25

5 Answers5

111

Aapt is a 32bit application. I am running ubuntu 64bit. I needed some additional libraries. First thing I did was update to 13.04 from 12.10. It broke chrome but this should help.

To get aapt working (this fixed my issues with the avd as well) just run these two commands:

sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1

From this post.

Now no more problems.

Community
  • 1
  • 1
omegacore
  • 1,712
  • 2
  • 12
  • 16
  • @VasilValchev Since OP is specifically asking about a 32bit program on the 64bit OS - consider reposting as a new question. – Clayton Apr 29 '14 at 18:19
  • What do I need for centos/yum? – EGHDK Sep 01 '15 at 18:53
  • Thanks.. without this my gradle never ended building the project – Zohair Dec 28 '15 at 05:46
  • Solution works on Ubuntu 16.04 as well. I had migrated my entire project from one machine to another, manually mapped the sdk folder, still was getting the error like OP. This solution fixed it. – Andrews Apr 17 '17 at 20:00
5

You can try this :-

sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev

Curious_Tom
  • 51
  • 1
  • 2
  • This one did work for me, the accepted answer did not. Which is weird, given the number of +1 on the other answer. Anyway, problem solved, thanks a lot. – Nighto Jan 16 '15 at 18:41
3

Just open your Terminal & run this

sudo apt-get install lib32stdc++6 lib32z1

Actually it was a architecture problem. Aapt expects 32 bit binaries and my system is 64 bits.

IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
0

Using Android Studio 0.3.7 on 64-bit Debian 7... this worked for me:

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

Building with Gradle is fine. Debugging and running the emulator is fine (although still slow as usual).

Kris Krause
  • 7,304
  • 2
  • 23
  • 26
0

The package (32-bit) you are looking for is libbz2-1.0:i386, its 64-bit version is libbz2-1.0:amd64.

At first enable multi-arch support (if not done already):

sudo dpkg --add-architecture i386

Now run:

sudo apt-get update

You can now install the package by:

sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
ranojan
  • 819
  • 8
  • 11