Reputation: 1714
I am trying to configure apache ant in my Ubuntu for python-for-android, as it is one of its prerequisites.
I followed this tutorial on YouTube but got an error at the end. Whenever I type ant on the terminal it shows this error.
/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 ")")
What I am Doing:
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
EDIT:
Here is the Traceback and is same for Buildozer and Python-for-Android. I tried to build apk from using both but error is same. It shows the same error as above before command fails and terminates and shows the traceback on the terminal.
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
Can anybody help??
Upvotes: 1
Views: 272
Reputation: 508
Ubuntu 14.04, 32-bit
Looks like you installed 64-bit Java 8 on 32-bit Ubuntu!
I had exactly the same error message, it solved after I replaced x64 Java dist with i586 (32-bit) dist. It was not related to Python, Android or Buildozer (I even had not had them installed on my machine).
Upvotes: 1
Reputation: 487
I had the same error message ("subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 2") and the solution for me was to start up the GUI by calling
~/.buildozer/android/platform/android-sdk-21/tools/android
and install the "Android SDK Build-Tools". A bit further up in the log file the missing build-tools were mentioned in my error log.
HTH.
Upvotes: 0