我正在尝试在我的Ubuntu for python-for-android中配置apache ant,因为它是prerequisites之一。
我在YouTube上关注this教程,但最后收到错误。每当我在终端上键入ant时,都会显示此错误。
/usr/lib/jvm/jdk1.8.0_45/jre/bin/java: 1: /usr/lib/jvm/jdk1.8.0_45/jre/bin/java: : not found
/usr/lib/jvm/jdk1.8.0_45/jre/bin/java: 1: /usr/lib/jvm/jdk1.8.0_45/jre/bin/java: : not found
/usr/lib/jvm/jdk1.8.0_45/jre/bin/java: 1: /usr/lib/jvm/jdk1.8.0_45/jre/b@@@@@@@��@@@@ |�
@@DDP�td��@�@6643Q�td/lib64/ld-linux-x86-64.so.2GNU GNU�t�)N�ݓ��;r�Z��?h: Directory nonexistent
/usr/lib/jvm/jdk1.8.0_45/jre/bin/java: 1: /usr/lib/jvm/jdk1.8.0_45/jre/bin/java: ELF: not found
/usr/lib/jvm/jdk1.8.0_45/jre/bin/java: 1: /usr/lib/jvm/jdk1.8.0_45/jre/bin/java: �: not found
/usr/lib/jvm/jdk1.8.0_45/jre/bin/java: 3: /usr/lib/jvm/jdk1.8.0_45/jre/bin/java: �: not found
/usr/lib/jvm/jdk1.8.0_45/jre/bin/java: 1: /usr/lib/jvm/jdk1.8.0_45/jre/bin/java: Syntax error: end of file
unexpected (expecting ")")
我在做什么:
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_45
export PATH=${PATH}:${JAVA_HOME}/bin
export ANT_HOME=/usr/apache/apache-ant-1.9.4
export PATH=${PATH}:${ANT_HOME}/bin
修改
这是Traceback,对于 Buildozer 和 Python-for-Android是相同的。我试图使用两者构建apk但错误是相同的。 它在命令失败之前显示与上面相同的错误并终止并显示终端上的回溯。
Traceback (most recent call last):
File "build.py", line 508, in <module>
make_package(args)
File "build.py", line 357, in make_package
subprocess.check_call([ANT, arg])
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 2
有人可以帮忙吗??
答案 0 :(得分:1)
Ubuntu 14.04,32位
看起来你在 32位 Ubuntu上安装了 64位 Java 8!
我有完全相同的错误消息,它在我用i586(32位)dist替换x64 Java dist后解决了。它与Python,Android或Buildozer无关(我甚至没有在我的机器上安装它们)。
答案 1 :(得分:0)
我有相同的错误消息(“subprocess.CalledProcessError:Command'['ant','debug']'返回非零退出状态2”)我的解决方案是通过调用<启动GUI / p>
~/.buildozer/android/platform/android-sdk-21/tools/android
并安装“Android SDK Build-Tools”。在日志文件中,我的错误日志中提到了缺少的构建工具。
HTH。