2012-07-19 119 views
3

我已經建立了詹金斯在debianserver,我試圖創建第一個Android組建,但螞蟻是不能被調用詹金斯,可執行失敗:java.io.IOException的Ant構建

在詹金斯的配置,我有:

Name: Java6 
    JAVA_HOME/usr/lib/jvm/java-6-sun 
    Name: AntHome 
    ANT_HOME/usr/share/ant 

在工作中的配置:

git > repo 
    Build step- 
    Ant invoke 
    Ant Version: AntHome 
    Targets: -d 
    build file: folder/folder/build.xml 

當我建工作它給我這個錯誤

[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 

我得到命令行相同

[email protected]:~/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 

它與這個特定的項目發生的事情,因爲我已經創建了別人,螞蟻-d工作:例如

[email protected]:~$ 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 
    [email protected]:~$ cd Project/ 
    [email protected]:~/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 
+0

你100%地肯定/home/dims/android-sdk-linux_x86-1.0_r2/tools/ aapt存在並且可以由jenkins用戶讀取/執行? – oers 2012-07-19 15:09:35

回答

9

這種奇特的錯誤發生時,您嘗試在64位系統上運行aapt(或需要該項目的項目),該系統缺少一些必需的32位庫(例如默認的Ubuntu> 9)。解決方案是安裝ia32-libs軟件包,其中包含

$ sudo apt-get install ia32-libs 

假設你不想安裝近300包,而不是運行此:

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

爲我解決了!謝謝一打! – PureSpider 2013-02-06 23:27:40

+0

我永遠不會猜到這個!非常感謝!!爲什麼這不被接受爲解決方案? – 2013-10-16 14:53:41

+0

我猜@BranGi停止使用StackOverflow。 – Torque 2013-10-16 16:22:22