"aapt" IOException error=2, No such file or directory" why can't I build my gradle on jenkins?

JavaAndroidJenkinsGradleAapt

Java Problem Overview


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.

Java Solutions


Solution 1 - Java

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

Solution 2 - Java

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

Solution 3 - Java

For Fedora users:

sudo dnf install zlib.i686 libstdc++.i686

Solution 4 - Java

I installed ndk in the sdk manager and it worked.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNeifenView Question on Stackoverflow
Solution 1 - JavarobdView Answer on Stackoverflow
Solution 2 - JavaCheezmeisterView Answer on Stackoverflow
Solution 3 - JavaJulien H. - SonarSource TeamView Answer on Stackoverflow
Solution 4 - JavaworkerView Answer on Stackoverflow