Command failed: ./distribute.sh -m "kivy" -d - 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.

Related

Tool unzip is missing, buildozer, kivy

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

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 buildozer deploy error

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**

Kivy Buildozer Permission Denied on ./distribute.sh -1

Ok so first before anything let me show the error
# Android packages installation done.
# Check application requirements
# Run './distribute.sh -l'
# Cwd /media/jonathon/Data Volume/Python Projects/Kivy Tutorial/.buildozer/android/platform/python-for-android
/bin/sh: 1: ./distribute.sh: Permission denied
# Command failed: ./distribute.sh -l
The command I am running is sudo buildozer android debug so I know I am running sudo and have root permissions.
Based on the file path in your error, you may be using a shared drive or remote file system. These can cause problems with permissions when buildozer tries to run and compile things. Try deleting ~/.buildozer, the .buildozer dir in your project, then moving the files to a local hard drive and running buildozer without sudo.

Categories

Resources