我正在尝试在我的Ubuntu中配置apache ant for python-for-android,因为它是它的先决条件之一。
我在YouTube上看了这个教程,但最后出现了一个错误。每当我在终端上输入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
有人能帮忙吗??
Ubuntu 14.04, 32位
看起来你在32位 Ubuntu上安装了64位 Java 8 !
我有完全相同的错误信息,它在我用i586(32位)dist替换x64 Java dist后解决了。它与Python, Android或Buildozer无关(我甚至没有在我的机器上安装它们)。
我有相同的错误消息("subprocess。CalledProcessError:命令'['ant', 'debug']'返回非零退出状态2"),我的解决方案是通过调用
启动GUI~/.buildozer/android/platform/android-sdk-21/tools/android
并安装"Android SDK Build-Tools"。在日志文件的更上面一点,我的错误日志中提到了缺失的构建工具。
HTH .