126

I have a little problem.

The Problem:
I am trying to build a gradle of my Android Project on Jenkins and now I am standing on this problem i can't resolve. During the Building I have this Error message:

:Client:mergeDebugResources
/var/lib/jenkins/workspace/LMA-Client/Client/build/exploded-aar/com.google.android.gms/play-services/3.1.59/res/drawable-hdpi/common_signin_btn_text_focus_light.9.png: 
Error: Cannot run program "/opt/android-sdk/build-tools/19.0.1/aapt": java.io.IOException: error=2, No such file or directory
:Client:mergeDebugResources FAILED

You can imagine that this aapt... yep its there and the png... its there too, so the mistake must be somewhere else.

The Solution?
Now I googled 1-2 hours around, surfed on this great Website and what I found is that if Jenkins runs on a 64-bit system, I need to install the ia32-libs. Like that:

sudo apt-get install ia32-libs

now I tried that, and I couldn't install it:

The following packages have unmet dependencies:
 ia32-libs : Depends: ia32-libs-multiarch

so I tried to install "ia32-libs-multiarch", but again:

The following packages have unmet dependencies:
 ia32-libs-multiarch:i386 : Depends: libgphoto2-2:i386 but it is not going to be installed
                            Depends: libsane:i386 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Finally
so finally im standing here and asking me: is that really the solution? And why should I install this thing? And how? So please help me, I think I am not far away from the answer.

gsamaras
  • 71,951
  • 46
  • 188
  • 305
Neifen
  • 2,546
  • 3
  • 19
  • 31
  • 1
    Possible duplicate of [Error: Cannot run aapt](http://stackoverflow.com/questions/18041769/error-cannot-run-aapt) – sschuberth Mar 25 '16 at 12:56
  • @sschuberth No but its similar. The Solution in that other thread didn't work for me. A possible duplicate is this one: http://stackoverflow.com/questions/18928164/android-studio-cannot-find-aapt/18930424#18930424 – Neifen Mar 29 '16 at 12:05

4 Answers4

335

I had the following similar error on Ubuntu 13.10:

Cannot run program "/usr/local/android-sdk-linux/build-tools/19.0.3/aapt": error=2, No such file or directory

And this answer fixed it for me:

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

sudo apt-get install lib32stdc++6 lib32z1
Community
  • 1
  • 1
robd
  • 9,646
  • 5
  • 40
  • 59
13

For Arch 64 users, you must first enable multilib for pacman, then install the 32-bit packages:

sudo pacman -Syv lib32-libstdc++5 lib32-zlib
Cheezmeister
  • 4,895
  • 3
  • 31
  • 37
6

For Fedora users:

sudo dnf install zlib.i686 libstdc++.i686
-2

I installed ndk in the sdk manager and it worked.

worker
  • 33
  • 3
  • 13
  • 1
    SDK Manager -> System Settings -> Android SDK -> Checkbox "Android NDK" - 1.0.0 Installed. I still get the OP's error. – JosephK Feb 15 '16 at 04:59