Jenkins Execute failed: java.io.IOException ant build

android, ant, hudson, java, jenkins

Solution

This peculiar error happens when you attempt to run aapt (or a project that requires it) on a 64 bit system that is lacking some required 32 bit libraries, such as a default Ubuntu > 9. The solution is to install the ia32-libs package with

$ sudo apt-get install ia32-libs

Assuming you don't want to install close to 300 packages, run this instead:

$ sudo apt-get install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386 --no-install-recommends

Problem

I have set up Jenkins on debianserver and I am trying to create the first android build but ant is not able to get invoked In jenkins configuration I have: ``` Name: Java6 JAVA_HOME/usr/lib/jvm/java-6-sun Name: AntHome ANT_HOME/usr/share/ant ``` On the job config: ``` git > repo Build step- Ant invoke Ant Version: AntHome Targets: -d build file: folder/folder/build.xml ``` When I build the job it gives me this error ``` [folder] $ /usr/share/ant/bin/ant -file build.xml -d /var/lib/jenkins/workspace/Project/folder/folder/build.xml:47: Execute failed: \ java.io.IOException: Cannot run program \ "/home/dims/android-sdk-linux_x86-1.0_r2/tools/aapt": \ java.io.IOException: error=2, No such file or directory ``` I get the same on command line ``` jenkins@host:~/workspace/Project/folder/folder$/usr/share/ant/bin/ant -d /var/lib/jenkins/workspace/Project/folder/folder/build.xml:47: Execute failed: \ java.io.IOException: Cannot run program \ "/home/dims/android-sdk-linux_x86-1.0_r2/tools/aapt": \ java.io.IOException: error=2, No such file or directory ``` It's happening with this particular project because I have created others and ant -d works: for example ``` jenkins@host:~$ android create project -n template -t android-10 -p Project -k some.pkg -a Some Created project directory: Project Created directory /var/lib/jenkins/Project/src/some/pkg Added file Project/src/some/pkg/Some.java Created directory /var/lib/jenkins/Project/res Created directory /var/lib/jenkins/Project/bin Created directory /var/lib/jenkins/Project/libs Created directory /var/lib/jenkins/Project/res/values Added file Project/res/values/strings.xml Created directory /var/lib/jenkins/Project/res/layout Added file Project/res/layout/main.xml Added file Project/AndroidManifest.xml Added file Project/build.xml Added file Project/proguard-project.txt jenkins@host:~$ cd Project/ jenkins@host:~/Project$ ant -d Apache Ant version 1.8.0 compiled on M .... [echo] unless 'nodeps' is used as well. BUILD SUCCESSFUL Total time: 0 seconds ```

Original source