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.
Related
While trying to just run the example program on my Android phone, I got this error while running buildozer android debug deploy run.
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Install platform
# Apache ANT found at /Users/USER/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /Users/USER/.buildozer/android/platform/android-sdk-20
# Android NDK found at /Users/USER/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Check garden requirements
# Compile platform
# Command failed: /Users/USER/miniconda3/envs/Kivy2New/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/Users/USER/Desktop/TestKivy/.buildozer/android/platform/build
#
# 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
All with after just installing Kivy, Cython 0.19 and running buildozer init.
The full log with level 2 here.
I am running Anaconda on OSX with Python 2 (But same error occurs when on Python 3).
Thanks!
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 debug is failing with following output
(cd /media/sf_virtual_box/organizer/2nd_vid_tute/step07_padding/.buildozer/android/platform/python-for-android/build/python-install/bin; ln python2.7 python)
ln: failed to create hard link ‘python’ => ‘python2.7’: Operation not permitted
make: *** [bininstall] Error 1
Leaving ARM environment
cp: cannot stat ‘build/lib.*-2.7/_ctypes*.so’: No such file or directory
# Command failed: ./distribute.sh -m "kivy" -d "myapp1"
#
# 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?
This will occur if the kivy project on the Virtual Machine is in a shared folder with the host machine.
(In my case the host is Windows.)
If this is the case, try copying the kivy project folder to /home/, and make sure this is not shared.
Make sure the permissions are set to 777.
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.
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
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 :)