Buildozer command failed - android

so I am trying to deploy a simple program to my Galaxy S5 with Buildozer. I run buildozer --verbose android debug deploy run which goes fine until the very last part:
Traceback (most recent call last):
File "build.py", line 491, in <module>
make_package(args)
File "build.py", line 354, in make_package
subprocess.check_call([ANT, arg])
File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
# Command failed: /usr/bin/python build.py --name 'School Organized' --version 1.2.0 -- package org.test.schoolorganized --private /home/jolechiw/School-Organized/.buildozer/android/app --sdk 14 --minsdk 8 --orientation landscape debug
The last part of the output can be found here. I really dont understand what went wrong with "Command Failed" but it might be a path error? I am really not sure.
EDIT:
I dont know if this matters but my source code for the app is here

I had, I believe, the same problem recently, and I'm fairly sure the problem was really the name of my app.
I don't think you can have a space in the name 'School Organized'. Try removing that or replacing it with an underscore (or whatever), wherever it appears in your buildozer.spec file, and build again.
I don't really have a way to check this was definitely the same error as mine, but it was at the least very similar and this tweak definitely fixed it.

today I had the same building issue. The problem was in Java itself rather than in buildozer.
It MUST be done using Java 7:
piotr#jnlk ~/Kivy/SomeApp $ which java
/usr/bin/java
piotr#jnlk ~/Kivy/SomeApp $ java -version
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
piotr#jnlk ~/Kivy/SomeApp $ buildozer android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
(...)
# Distribution already compiled, pass.
# Build the application #137
# Package the application
# Command failed: /usr/bin/python2 build.py (...) --orientation landscape debug
Building with Java8 fails, but when I changed JAVA_HOME variable to the location of Java7:
piotr#jnlk ~/Kivy/SomeApp $ export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
piotr#jnlk ~/Kivy/SomeApp $ export PATH=${JAVA_HOME}/bin:${PATH}
piotr#jnlk ~/Kivy/SomeApp $ java -version
java version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1~0.13.10.1)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)
piotr#jnlk ~/Kivy/SomeApp $ buildozer android debug
piotr#jnlk ~/Kivy/SomeApp $ buildozer android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
(...)
# Android packages installation done.
# Check application requirements
# Check garden requirements
# Compile platform
# Distribution already compiled, pass.
# Build the application #138
# Package the application
# Android packaging done!
# APK <some-app-name>.apk available in the bin directory
Building was completed successfully :)

Related

Command failed: ./distribute.sh -l

I am trying to follow the instructions on https://kivy.org/docs/guide/packaging-android-vm.html to create kivy android applications. I installed Kivy Buildozer VM and was following instructions on the Readme file. Created the buildozer.spec file using buildozer init command but buildozer android debugis failing with following output
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian `dpkg' package management program version 1.17.5 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
# -> found at /usr/bin/git
# Search for Cython (cython)
# -> found at /usr/local/bin/cython
# Search for Java compiler (javac)
# -> found at /usr/lib/jvm/java-7-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
# -> found at /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/keytool
# Install platform
# Apache ANT found at /home/kivy/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/kivy/.buildozer/android/platform/android-sdk-21
# Android NDK found at /home/kivy/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Run './distribute.sh -l'
# Cwd /media/sf_virtual_box/organizer/2nd_vid_tute/tut1_vid4/.buildozer/android/platform/python-for-android
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PYTHON-FOR-ANDROID ERROR! SEE BELOW FOR SOLUTION:
You are trying to run an old version of python-for-android via
distribute.sh. However, python-for-android has been rewritten and no
longer supports the distribute.sh interface.
If you are using buildozer, you should:
- upgrade buildozer to the latest version (at least 0.30)
- delete the .buildozer folder in your app directory (the same directory that has your buildozer.spec)
- run buildozer again as normal
If you are not using buildozer, see
https://github.com/kivy/python-for-android/blob/master/README.md for
instructions on using the new python-for-android
toolchain. Alternatively, you can get the old toolchain from the
'old_toolchain' branch at
https://github.com/kivy/python-for-android/tree/old_toolchain .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Command failed: ./distribute.sh -l
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
Then I tried to update using buildozer android update But fails giving the following output
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian `dpkg' package management program version 1.17.5 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
# -> found at /usr/bin/git
# Search for Cython (cython)
# -> found at /usr/local/bin/cython
# Search for Java compiler (javac)
# -> found at /usr/lib/jvm/java-7-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
# -> found at /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/keytool
# Install platform
# Run 'git clean -dxf'
# Cwd /media/sf_virtual_box/organizer/2nd_vid_tute/tut1_vid4/.buildozer/android/platform/python-for-android
# Run 'git pull origin master'
# Cwd /media/sf_virtual_box/organizer/2nd_vid_tute/tut1_vid4/.buildozer/android/platform/python-for-android
From https://github.com/kivy/python-for-android
* branch master -> FETCH_HEAD
Already up-to-date.
# Apache ANT found at /home/kivy/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/kivy/.buildozer/android/platform/android-sdk-21
# Android NDK found at /home/kivy/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Run './distribute.sh -l'
# Cwd /media/sf_virtual_box/organizer/2nd_vid_tute/tut1_vid4/.buildozer/android/platform/python-for-android
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PYTHON-FOR-ANDROID ERROR! SEE BELOW FOR SOLUTION:
You are trying to run an old version of python-for-android via
distribute.sh. However, python-for-android has been rewritten and no
longer supports the distribute.sh interface.
If you are using buildozer, you should:
- upgrade buildozer to the latest version (at least 0.30)
- delete the .buildozer folder in your app directory (the same directory that has your buildozer.spec)
- run buildozer again as normal
If you are not using buildozer, see
https://github.com/kivy/python-for-android/blob/master/README.md for
instructions on using the new python-for-android
toolchain. Alternatively, you can get the old toolchain from the
'old_toolchain' branch at
https://github.com/kivy/python-for-android/tree/old_toolchain .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Command failed: ./distribute.sh -l
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
How can I fix this?
If you are gettting this error in the Kivy Android Build Image you should update buildozer like this:
1.type
sudo pip install -U buildozer
2. delete the .buildozer folder in your app folder
The sudo password for this image is kivy123
type
buildozer -v android debug
to see what happens during compilation.
As you can see here python-for-android the distribute.sh file is not supposed to be used anymore. Here you have a guide how to use buildozer directly.

Command failed: tar xzf android-sdk_r20-linux.tgz

I was trying to build kivy app to android and got this error
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Install platform
# Apache ANT found at /home/ali/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK is missing, downloading
# Unpacking Android SDK
# Command failed: tar xzf android-sdk_r20-linux.tgz
#
# Buildozer failed to execute the last command
# If the error is not obvious, please raise the log_level to 2
# and retry the latest command.
# In case of a bug report, please add a full log with log_level = 2
command
$ buildozer android_new debug
log:
http://paste.ubuntu.com/20850804/
want any details? request in the comments
The machine fails to properly download the android SDK.
You can confirm this by checking the md5 sum of the file :
wget -O - http://dl.google.com/android/android-sdk_r20-linux.tgz | md5sum
This should output : 22a81cf1d4a951c62f71a8758290e9bb
If it doesn't, my first guess would be that you're blocked by some kind of proxy or firewall. A proxy can be configured to limit the maximum size of a a file you're trying to download. Check the logs or contact your sysadmins if you're not the administrator of the machine.
I figured it out!
the problem was some google services are not available where i live due to USA sanctions on my country (Sudan) and the returned response is html (not in gzip format).
the solution is to use vpn.

Kivy Apk build with buildozer error: # Java compiler (javac) not found, please install it

I'm trying to build an apk of my kivy project.
I have installed buildozer in python 2.7 Using PyCharm, then I built the .spec,
but when I tried to create the apk, I got these results:
i have insatalled jdk7 and 8
Using: buildozer Android debug
#Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Java compiler (javac) not found, please install it.
Using:  buildozer -v Android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Read available permissions from api-versions.xml
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
/bin/sh: dpkg: comando non trovato
# Search for Git (git)
# -> found at /usr/bin/git
# Search for Cython (cython)
# -> found at /usr/bin/cython
# Search for Java compiler (javac)
# Java compiler (javac) not found, please install it.
Using: buildozer Android debug deploy run
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Java compiler (javac) not found, please install it.
How do I get this to work?
You need to install Java Development Kit. If you are using Debian based system (Ubuntu, Linux mint, etc.) just type in terminal: sudo apt-get install openjdk-8-jdk. On windows you must visit Java website and download Java JDK manually.
To check if you have installed Java JDK, type in console javac -version, you should see message like this: javac 1.8.0_91
The error seems fairly explicit - install javac.
This is probably in a java related package of your distro's package manager. It probably has search functionality to find the one you want.
######check this out. It's working ##########
Download Java
Open your web browser
Type URL: https://www.oracle.com/java/technologies/javase-downloads.html... to go to Oracle download page. This will lead you <> page
Click on button “ JDK download ” for Java SE update 4.
Accept oracle license agreement
Find and click on the correct jdk download link right for your operating system to download
Save the file to disk
NOTE >>>>> if you find this word (version) which means you should change it depending on your downloaded version
---- if you use linux
2 cd Downloads
3 ls
4 sudo dpkg -i jdk-(VERSION)_linux-x64_bin.deb
5 sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/(version)/bin/java 1
6 sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/(VERSION)/bin/javac 1
<>>>if it doesn't work then u essentially need to change the (version) in the commands above as mentioned at the note

Android SDK tools crash on startup

I am trying to run my android SDK tools. When they startup they crash with this error. It happens no matter if I run it from the terminal or if I launch it from Android Studio.
Jareds-Mac-mini:~ jared$ android
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fff9b25482f, pid=71482, tid=8207
#
# JRE version: Java(TM) SE Runtime Environment (8.0_45-b14) (build 1.8.0_45-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [AppKit+0x53382f] -[NSDatePickerCell(NSTextFieldWithStepperDatePickerInternal) _concoctUnholyAbominationOfADateFormatThatMakesAMockeryOfLocalization]+0x0
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/jared/hs_err_pid71482.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Abort trap: 6
The OS X error report is in this paste bin
https://pastebin.mozilla.org/8831994
I uninstalled and reinstalled the android SDK and tools. I then restarted my Mac twice and it started working. I can't seem to find out why it happened but it's fixed now. The error logs are open for you to view.

Android compile error using buildozer

I am trying to compile an .apk (this one) using buildozer. But I keep getting the command failed message below. I've tried using a different python path, reinstalling buildozer, using different buildozer paths, compiling from Mac HD, compiling with sudo, a different cython version. None work.
Traceback (most recent call last):
File "build.py", line 497, in
make_package(args)
File "build.py", line 351, in make_package
subprocess.check_call([ANT, arg])
File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
Command failed: /usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python build.py --name 'My Application' --version 1.2.0 --package org.test.myapp --private /Users/user/Documents/Py/kvapk/.buildozer/android/app --sdk 14 --minsdk 8 --permission INTERNET --permission ACCESS_NETWORK_STATE --orientation portrait debug
I'm on OSX Mavericks using python 2.7.5, kivy 1.8.0, cython 0.19 and buildozer 0.17
Here is the total output: https://gist.github.com/feynman21/29d2f02c387112f2900b
This is an issue with buildozer failing to install the Android build-tools. Hopefully this will be fixed soon. Until then, you can work around this by manually installing build-tools (https://github.com/kivy/buildozer/issues/146#issuecomment-57061269):
Run ~/.buildozer/android/platform/android-sdk-21/tools/android to launch the Android SDK Manager. (If you have a different SDK version, replace android-sdk-21 with the appropriate folder)
Click the Deselect All link at the bottom of the window, and check the box next to "Android SDK Build-tools -- 20". (Note: the exact version doesn't matter, just pick the newest version available.)
Click the Install 1 package... button.
Click Accept License and then click the Install button.
Close the SDK Manager and resume working with buildozer.

Categories

Resources