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

42,945

Solution 1

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

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

For Fedora users:

sudo dnf install zlib.i686 libstdc++.i686
Share:
42,945
Neifen
Author by

Neifen

I am a quite new developer with experience in Java, HTML, PHP, C and C++. I also know a little about Javascript, Mysql, Actionscript, C#, VB and Powershell/Batch. I try to help people with the bit of knowledge that I have. I want also to acquire more knowledge here. Normaly I speak german and French, so excuse my bad english knowledge.

Updated on August 26, 2020

Comments

  • Neifen
    Neifen over 3 years

    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.

  • Mike Chelen
    Mike Chelen about 10 years
    That fixed the problem for me in Ubuntu 14.04
  • MinceMan
    MinceMan almost 10 years
    That fixed it for me in Ubuntu 14.04 as well.
  • guyland123
    guyland123 over 9 years
    building chrome on Ubuntu 14.04 and this helped get me by the same error I was having with aapt. Note ldd aapt now works, and shows dependencies. Previously it stated that the program wasn't a dynamic executable "not a dynamic executable". Now on to the next problem!
  • CesarTrigo
    CesarTrigo over 9 years
    Amen! also fix node exec aapt issues
  • Khai Dinh
    Khai Dinh over 9 years
    Fixed my issue as well on Ubuntu 14.04, while running an ionic framework build.
  • Leo Moore
    Leo Moore over 9 years
    Thanks. That fixed it for me in Ubuntu 14.10. I presume it must require these 32 bit libraries which are not installed by default in 64 bit Ubuntu
  • JosephK
    JosephK about 8 years
    SDK Manager -> System Settings -> Android SDK -> Checkbox "Android NDK" - 1.0.0 Installed. I still get the OP's error.
  • JosephK
    JosephK about 8 years
    In CentOS, these packages are non-existent. yum install libstdc++-4.8.5-4.el7.i686 zlib.i686 . That worked for me.
  • IgorGanapolsky
    IgorGanapolsky over 7 years
    What about on a mac??
  • JehandadK
    JehandadK over 7 years
    Use brew on mac for same packages
  • Vishwesh Jainkuniya
    Vishwesh Jainkuniya over 7 years
    Thanks searching lot i got this answer and it works.
  • Dee
    Dee almost 7 years
    luckily my centos is just the same like fedora :)
  • soywod
    soywod almost 6 years
    Worked like a charm (4.16.13-2-ARCH), I just had to replace my x64 image by x86 one
  • Admin
    Admin over 5 years
    Confirmed this to be working on Ubuntu Server 18.04.1 as well.
  • gervais.b
    gervais.b almost 5 years
    I had the same issue. Trying to execute ./aapt manually returned "no such file or directory: ./aapt" (Zsh). This worked.