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.
Related
I am new to kivy, and try to build an app for android using kivy.
When i was creating an apk for the app
buildozer android debug
with log_level=2
it shows:
Tool unzip is missing
Command failed: ./distribute.sh -m "kivy" -d "kivytut"
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
I'm unable to find any tool called upzip for buidozer(python-for-android) on the internet.
Help.
install unzip using:
sudo apt-get install unzip
moreover following are the tools that must be installed:
git
ant
python2
cython (can be installed via pip)
a Java JDK (e.g. openjdk-7)
zlib (including 32 bit)
libncurses (including 32 bit)
unzip
virtualenv (can be installed via pip)
ccache (optional)
These are several dependencies for python-for-android
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 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.
I am running "buildozer android deploy" command to install my kivy app in my samsung tablet. (Ubuntu 32 bit)
It work all the time but since yesterday it generate the error below:
I have never edited any of the adb file, thus I don't understand why Syntax error: ")" unexpected.
I try un-install and re-install buildozer but it couldn't help.
anyone have any idea how can I fix it?
# Distribution already compiled, pass.
# Run '/home/user/.buildozer/android/platform/android-sdk-20/platform-tools/adb devices'
# Cwd None
/home/user/.buildozer/android/platform/android-sdk-20/platform-tools/adb: 1: /home/user/.buildozer/android/platform/android-sdk-20/platform-tools/adb: **Syntax error: ")" unexpected
# Command failed: /home/user/.buildozer/android/platform/android-sdk-20/platform-tools/adb devices****
#
# 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**
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