3

我已经在 debianserver 上设置了 Jenkins,我正在尝试创建第一个 android 版本,但无法调用 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

我在命令行上得到相同的结果

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

这个特定项目正在发生这种情况,因为我创建了其他项目并且 ant -d 有效:例如

    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
4

1 回答 1

9

当您尝试在缺少一些必需的 32 位库(例如默认的 Ubuntu > 9)的 64 位系统上运行 aapt(或需要它的项目)时,会发生此特殊错误。解决方案是安装 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
于 2012-12-31T19:54:52.800 回答