我在debianserver上设置了Jenkins,我正在尝试创建第一个android构建但是ant无法被调用
在jenkins配置中我有:
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
答案 0 :(得分:9)
当您尝试在缺少某些必需的32位库的64位系统上运行aapt(或需要它的项目)时会发生这种特殊错误,例如默认的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