Does kivy has opencv or image processing library? - android

Does anyone know if kivy has image processing library?? I am planning to do android application project for one of my class but I do not know java. I have experience with c++ and python and I know there are some development tools for android app. I prefer to use python but c++ is also good. So anyone have information?? Thanks.

One thing you can easily do is to import numpy to your as usual, write your code accordingly. You can almost do any image processing with numpy, however it won't be accelerated...
Anyways, while building the Kivy application's apk file (I would advise you to use buildozer from github), just include it to your build. Here is an example of adding numpy to your apk build by adjusting specific line in buildozer.spec:
requirements = kivy,numpy
As far as I know, these are the modules you can add to your kivy code while building apk:
android apsw audiostream c_igraph cymunk django docutils ffmpeg gevent
greenlet hostpython igraph jpeg kivent kivy libevent libswift libxml2
libxslt lxml m2crypto msgpack mysql_connector netifaces numpy openssl
paramiko pil plyer png polygon psutil pyasn1 pycrypto pygame pyjnius
pylibpd pyopenssl pyparsing pyqrcode python sdl setuptools sqlalchemy
sqlite3 swift twisted txws wokkel zope
Let me know, if this satisfy your needs.

Related

how to import python PIL on android and kivy?

I want to create an application that takes photos from camera and show thumbnails of them on android. The related part of my code is:
from plyer import camera
from PIL import Image
.
.
.
def take_photo_from_camera(self, x):
filename = str(random.randint(0, 100000000000)) # create random filenames
self.camera.take_picture("/storage/sdcard0/MyApp/%s.jpg"%(filename), self.on_success_shot)
def on_success_shot(self, path):
#Create a thumbnail of taken photo here using PIL
I can use android camera without any problem.
I've added the PIL/pillow to the requirements of the kivy buildozer.spec file
requirements = kivy, openssl, futures, requests, plyer, pyjnius, pillow
When i want to create an apk with this configuration, the apk package succesfully builds but if i install apk and run on my android phone, i'm getting this error in logcat:
I/python (20188): Traceback (most recent call last):
I/python (20188): File "/home/mnrl/teknik/.buildozer/android/app/main.py", line 32, in <module>
I/python (20188): File "/home/mnrl/teknik/.buildozer/android/app/_applibs/PIL/Image.py", line 67, in <module>
I/python (20188): ImportError: dlopen failed: "/data/data/org.tokerteknik.tokerteknik/files/_applibs/PIL/_imaging.so" is 64-bit instead of 32-bit
I/python (20188): Python for android ended.
I think the problem related to architecture. I'm using ubuntu 16.04 64 bit and kivy buildozer installs 64 bit libraries with pip while installing requirements.
A similar problem here too: https://github.com/kivy/kivy/issues/4095 but there's not any solution.
Briefly how can i import PIL on android with kivy buildozer or how to install 32 bit libraries of PIL on 64 bit system?
Use pygame instead of PIL for basic image manipulation processes.
Add pygame to the buildozer requirements list, it works without any problem.
import pygame
picture = pygame.image.load(filepath)
picture = pygame.transform.scale(picture, (100, 100))
pygame.image.save(picture, "scaled_image.png")

Python, Kivy, Buildozer: error using python-firebase/requests

[Python = 2.7]
I recently started to use kivy (newest version) to develop an app for Android. For this I use buildozer (newest version) to create the apk file. Now everything works fine on my computer even using the python-firebase module. To send data to the Firebase online database. But when I want to use the Python module python-firebase (that is based on the module requests) on my phone the app crashes after it loads for a few seconds.
For now my requirements in the buildozer.spec are plyer and kivy. If I try to add requests to this list, I get the error:
# Install requirement requests in virtualenv
# Run 'pip install --download-cache=/home/notwaka/.buildozer/cache --target=/home/notwaka/Desktop/Gps/.buildozer/applibs requests'
# Cwd /home/notwaka/Desktop/Gps/.buildozer
Usage:
pip install [options] <requirement specifier> [package-index-options] ...
pip install [options] -r <requirements file> [package-index-options] ...
pip install [options] [-e] <vcs project url> ...
pip install [options] [-e] <local project path> ...
pip install [options] <archive url/path> ...
no such option: --download-cache
# Command failed: pip install --download-cache=/home/notwaka/.buildozer/cache --target=/home/notwaka/Desktop/Gps/.buildozer/applibs requests
#
# Buildozer failed to execute the last command
Do I need to add requests to the requirements, since it is done in an example in the documentation of using buildozer? What can I do to make python-firebase working on my Android device? I have no knowledge about how to make a recipe and can't find any good documentation about this. Could making a recipe work? Has anyone tried to get Firebase working with Python on Android?
'# Check application requirements
# Run './distribute.sh -l'
# Cwd /home/notwaka/Desktop/try/.buildozer/android/platform/python-for-android
Available modules: android apsw audiostream bidi boost cherrypy c_igraph click cprotobuf cymunk django docutils ecdsa enum34 evdev ffmpeg ffmpeg2 ffpyplayer ffpyplayer_tito flask freetype gevent greenlet harfbuzz hostpython igraph itsdangerous jinja2 jpeg kivent_core kivent_cymunk kivy leveldb libevent libpq libsodium libswift libtorrent libxml2 libxslt libyaml lxml m2crypto markupsafe midistream msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer plyvel png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools six sqlalchemy sqlite3 storm swift thrift twisted txws werkzeug wokkel zeroconf zope
# Remove directory and subdirectory /home/notwaka/Desktop/try/.buildozer/applibs
# Create directory /home/notwaka/Desktop/try/.buildozer/applibs
# Run 'bash -c "source venv/bin/activate && env"'
# Cwd /home/notwaka/Desktop/try/.buildozer
LC_PAPER=nl_NL.UTF-8
XDG_VTNR=7
LC_ADDRESS=nl_NL.UTF-8
XDG_SESSION_ID=c2
CLUTTER_IM_MODULE=xim
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/notwaka
SELINUX_INIT=YES
LC_MONETARY=nl_NL.UTF-8
GPG_AGENT_INFO=/run/user/1000/keyring-wWFm7x/gpg:0:1
VTE_VERSION=3409
SHELL=/bin/bash
TERM=xterm
LC_NUMERIC=nl_NL.UTF-8
WINDOWID=65011724
UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/1938
GNOME_KEYRING_CONTROL=/run/user/1000/keyring-wWFm7x
GTK_MODULES=overlay-scrollbar:unity-gtk-module
USER=notwaka
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
LC_TELEPHONE=nl_NL.UTF-8
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
SSH_AUTH_SOCK=/run/user/1000/keyring-wWFm7x/ssh
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
VIRTUAL_ENV=/home/notwaka/Desktop/try/.buildozer/venv
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
PATH=/home/notwaka/Desktop/try/.buildozer/venv/bin:/home/notwaka/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/notwaka/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
DESKTOP_SESSION=ubuntu
QT_IM_MODULE=ibus
ANDROIDAPI=19
QT_QPA_PLATFORMTHEME=appmenu-qt5
LC_IDENTIFICATION=nl_NL.UTF-8
JOB=gnome-session
PWD=/home/notwaka/Desktop/try/.buildozer
XMODIFIERS=#im=ibus
LANG=en_US.UTF-8
GNOME_KEYRING_PID=1936
GDM_LANG=en_US
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
LC_MEASUREMENT=nl_NL.UTF-8
ANDROIDNDK=/home/notwaka/.buildozer/android/platform/android-ndk-r9c
IM_CONFIG_PHASE=1
COMPIZ_CONFIG_PROFILE=ubuntu
PS1=(venv)
GDMSESSION=ubuntu
PACKAGES_PATH=/home/notwaka/.buildozer/android/packages
SESSIONTYPE=gnome-session
HOME=/home/notwaka
SHLVL=2
XDG_SEAT=seat0
LANGUAGE=en_US
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
UPSTART_INSTANCE=
UPSTART_EVENTS=started starting
ANDROIDSDK=/home/notwaka/.buildozer/android/platform/android-sdk-20
LOGNAME=notwaka
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-lqf94SPFU0
QT4_IM_MODULE=xim
LESSOPEN=| /usr/bin/lesspipe %s
ANDROIDNDKVER=r9c
UPSTART_JOB=unity-settings-daemon
INSTANCE=Unity
TEXTDOMAIN=im-config
DISPLAY=:0
XDG_RUNTIME_DIR=/run/user/1000
XDG_CURRENT_DESKTOP=Unity
GTK_IM_MODULE=ibus
LESSCLOSE=/usr/bin/lesspipe %s %s
LC_TIME=nl_NL.UTF-8
TEXTDOMAINDIR=/usr/share/locale/
LC_NAME=nl_NL.UTF-8
XAUTHORITY=/home/notwaka/.Xauthority
COLORTERM=gnome-terminal
_=/usr/bin/env
# Install distribute
# Run 'curl http://python-distribute.org/distribute_setup.py | venv/bin/python'
# Cwd /home/notwaka/Desktop/try/.buildozer
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
# Install requirement pygments in virtualenv
# Run 'pip install --download-cache=/home/notwaka/.buildozer/cache --target=/home/notwaka/Desktop/try/.buildozer/applibs pygments'
# Cwd /home/notwaka/Desktop/try/.buildozer
Usage:
pip install [options] <requirement specifier> [package-index-options] ...
pip install [options] -r <requirements file> [package-index-options] ...
pip install [options] [-e] <vcs project url> ...
pip install [options] [-e] <local project path> ...
pip install [options] <archive url/path> ...
no such option: --download-cache
# Command failed: pip install --download-cache=/home/notwaka/.buildozer/cache --target=/home/notwaka/Desktop/try/.buildozer/applibs pygments
#
# 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
'
There is an issue for Firebase working on python Kivy. See https://github.com/ozgur/python-firebase/pull/26
This is because multicore processing is not fully supported on Kivy, which is used by Firebase. This caused the crash on kivy Firebase apps.
I haven't tried the patch yet, but looking at the comments, Zkanda did good. This might be what you're looking for.
Alternatively, you can use json to download data from Firebase.
What I did to use Firebase was to use python's native Requests library to make a json call to Firebase, which they support with https.
import json, requests
url = "https://myfirebaseurl.firebaseio.com/some_database.json"
resp = requests.get(url = url, json = {'create':True})
data = resp.json()
In your buildozer.spec file, under the Requirements, include
requirements = kivy,requests,simplejson,openssl
openssl is to support https, simplejson is for json.
no such option: --download-cache
This reflects a bug in python-for-android that is now fixed. If you make buildozer re-download python-for-android, e.g. by deleting the .buildozer dir in your build directory, it should work.
You can also edit the current downloaded distribute.sh to remove the --download-cache option when calling pip.
I tried the suggested solution when encountering a similar issue with pygments, and it didn't work for me either. I increased log levels and found that pygments was being downloaded to lib64/python on my distro, whereas pip was looking for lib/python.
It appears to be related to this pip issue: https://github.com/pypa/pip/issues/3056
I added a setup.cfg file in the .buildozer folder for my app, containing:
[install]
install-purelib=$base/lib64/python
and my app now installs successfully.

Building apk file with buildozer error Command failed: ./distribute.sh -m "kivy" -d

I'm making an apk from python and kivy for the first time so if this is some newbie question sorry.
I want to build app for android from python and kivy scrips using buildozer tool. After few newbie errors like I didn't install javac etc., this error occurred:
Command failed: ./distribute.sh -m "kivy" -d "carlockapp"
Additional info:
OS: Fedora 22 32bit
[agi#localhost CarLockApp]$ buildozer android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
/bin/sh: dpkg: command not found
# Search for Git (git)
# -> found at /usr/bin/git
# Search for Cython (cython)
# -> found at /usr/bin/cython
# Search for Java compiler (javac)
# -> found at /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-14.b27.fc22.i386/bin/javac
# Search for Java keytool (keytool)
# -> found at /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-14.b27.fc22.i386/jre/bin/keytool
# Install platform
# Apache ANT found at /home/agi/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/agi/.buildozer/android/platform/android-sdk-21
# Android NDK found at /home/agi/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Run './distribute.sh -l'
# Cwd /home/agi/Documents/CarLockApp/.buildozer/android/platform/python-for-android
which: no virtualenv-2.7 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
which: no virtualenv2.7 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
which: no virtualenv2 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
which: no cython2 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
Available modules: android apsw audiostream bidi boost cherrypy c_igraph cprotobuf cymunk django docutils ecdsa enum34 evdev ffmpeg ffmpeg2 ffpyplayer freetype gevent greenlet harfbuzz hostpython igraph jpeg kivent_core kivent_cymunk kivy leveldb libevent libpq libsodium libswift libtorrent libxml2 libxslt libyaml lxml m2crypto midistream msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer plyvel png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools six sqlalchemy sqlite3 storm swift thrift twisted txws wokkel zeroconf zope
# Application requirements already installed, pass
# Check garden requirements
# Compile platform
# Run './distribute.sh -l'
# Cwd /home/agi/Documents/CarLockApp/.buildozer/android/platform/python-for-android
which: no virtualenv-2.7 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
which: no virtualenv2.7 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
which: no virtualenv2 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
which: no cython2 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
Available modules: android apsw audiostream bidi boost cherrypy c_igraph cprotobuf cymunk django docutils ecdsa enum34 evdev ffmpeg ffmpeg2 ffpyplayer freetype gevent greenlet harfbuzz hostpython igraph jpeg kivent_core kivent_cymunk kivy leveldb libevent libpq libsodium libswift libtorrent libxml2 libxslt libyaml lxml m2crypto midistream msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer plyvel png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools six sqlalchemy sqlite3 storm swift thrift twisted txws wokkel zeroconf zope
# Clean and build python-for-android
# Remove directory and subdirectory /home/agi/Documents/CarLockApp/.buildozer/android/platform/python-for-android/dist/carlockapp
# Run './distribute.sh -m "kivy" -d "carlockapp"'
# Cwd /home/agi/Documents/CarLockApp/.buildozer/android/platform/python-for-android
which: no virtualenv-2.7 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
which: no virtualenv2.7 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
which: no virtualenv2 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
which: no cython2 in (/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin)
./distribute.sh: line 286: lsb_release: command not found
Check build dependencies for
Avoid check build dependencies, unknow platform
Check environment
SDK located at /home/agi/.buildozer/android/platform/android-sdk-21
NDK located at /home/agi/.buildozer/android/platform/android-ndk-r9c
NDK version is r9c
API level set to 14
Check NDK location
Check mandatory tools
Distribution will be located at /home/agi/Documents/CarLockApp/.buildozer/android/platform/python-for-android/dist/carlockapp
Entering in ARM environment
Compiler found at /home/agi/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
PATH is /home/agi/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/:/home/agi/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/:/home/agi/.buildozer/android/platform/android-ndk-r9c:/home/agi/.buildozer/android/platform/android-sdk-21/tools:/home/agi/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/agi/.local/bin:/home/agi/bin
Leaving ARM environment
Read kivy recipe
Module kivy depend on pygame pyjnius android
Read pygame recipe
Module pygame depend on python sdl
Read pyjnius recipe
Module pyjnius depend on python sdl
Read android recipe
Module android depend on pygame
Read python recipe
Module python depend on hostpython
Read sdl recipe
Module sdl depend on python
Ignored python, already processed
Ignored sdl, already processed
Ignored pygame, already processed
Read hostpython recipe
Ignored python, already processed
Modules changed to hostpython python sdl pygame pyjnius android kivy
Pure-Python modules changed to
Run get packages
Download package for hostpython
Module hostpython already downloaded
Download package for python
Module python already downloaded
Download package for sdl
No package for sdl
Download package for pygame
Module pygame already downloaded
Download package for pyjnius
Module pyjnius already downloaded
Download package for android
No package for android
Download package for kivy
Module kivy already downloaded
Run prebuild
Call prebuild_hostpython
Call prebuild_python
# Command failed: ./distribute.sh -m "kivy" -d "carlockapp"
#
# 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

Unable to get Buildozer to work in ubuntu - "fatal error: arm-linux-gnueabi/python2.7/pyconfig.h: No such file or directory"

I am trying to build a very basic Hello World Android application using kivy. Source code:
import kivy
kivy.require('1.8.0') # update with your current version
from kivy.app import App
from kivy.uix.button import Button
class DummyApp(App):
def build(self):
return Button(text="Hello World")
if __name__ == '__main__':
DummyApp().run()
I tried to build the app using Buildozer, using the command (along with this spec file):
buildozer android debug
But instead of building successfully I am getting the error -
fatal error: arm-linux-gnueabi/python2.7/pyconfig.h: No such file or directory
I could find this and similar errors on many forums, but wasn't able to find any fix. The complete error log is as follows (obtained using log_level = 2 in spec file):
# 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
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/kedia-abhishek/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/kedia-abhishek/.buildozer/android/platform/android-sdk-21
# Android NDK found at /home/kedia-abhishek/.buildozer/android/platform/android-ndk-r9c
# Read available permissions from api-versions.xml
# Check application requirements
# Run './distribute.sh -l'
# Cwd /home/kedia-abhishek/Desktop/buildozer/.buildozer/android/platform/python-for-android
Available modules: android apsw audiostream bidi boost cherrypy c_igraph cprotobuf cymunk django docutils ecdsa enum34 evdev ffmpeg ffmpeg2 ffpyplayer freetype gevent greenlet harfbuzz hostpython igraph jpeg kivent_core kivent_cymunk kivy leveldb libevent libpq libsodium libswift libtorrent libxml2 libxslt libyaml lxml m2crypto midistream msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer plyvel png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools six sqlalchemy sqlite3 storm swift thrift twisted txws wokkel zeroconf zope
# Application requirements already installed, pass
# Check garden requirements
# Compile platform
# Run './distribute.sh -l'
# Cwd /home/kedia-abhishek/Desktop/buildozer/.buildozer/android/platform/python-for-android
Available modules: android apsw audiostream bidi boost cherrypy c_igraph cprotobuf cymunk django docutils ecdsa enum34 evdev ffmpeg ffmpeg2 ffpyplayer freetype gevent greenlet harfbuzz hostpython igraph jpeg kivent_core kivent_cymunk kivy leveldb libevent libpq libsodium libswift libtorrent libxml2 libxslt libyaml lxml m2crypto midistream msgpack mysql_connector netifaces numpy opencv openssl paramiko pil plyer plyvel png polygon protobuf psutil psycopg2 pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python pyyaml sdl setuptools six sqlalchemy sqlite3 storm swift thrift twisted txws wokkel zeroconf zope
# Clean and build python-for-android
# Remove directory and subdirectory /home/kedia-abhishek/Desktop/buildozer/.buildozer/android/platform/python-for-android/dist/helloworldapp
# Run './distribute.sh -m "kivy" -d "helloworldapp"'
# Cwd /home/kedia-abhishek/Desktop/buildozer/.buildozer/android/platform/python-for-android
Check build dependencies for Ubuntu
Packages missing: cython
It might break the compilation, except if you installed thoses packages manually.
Check environment
SDK located at /home/kedia-abhishek/.buildozer/android/platform/android-sdk-21
NDK located at /home/kedia-abhishek/.buildozer/android/platform/android-ndk-r9c
NDK version is r9c
API level set to 14
Check NDK location
Check mandatory tools
Distribution will be located at /home/kedia-abhishek/Desktop/buildozer/.buildozer/android/platform/python-for-android/dist/helloworldapp
Entering in ARM environment
Compiler found at /home/kedia-abhishek/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin//arm-linux-androideabi-gcc
PATH is /home/kedia-abhishek/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/:/home/kedia-abhishek/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/:/home/kedia-abhishek/.buildozer/android/platform/android-ndk-r9c:/home/kedia-abhishek/.buildozer/android/platform/android-sdk-21/tools:/home/kedia-abhishek/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Leaving ARM environment
Read kivy recipe
Module kivy depend on pygame pyjnius android
Read pygame recipe
Module pygame depend on python sdl
Read pyjnius recipe
Module pyjnius depend on python sdl
Read android recipe
Module android depend on pygame
Read python recipe
Module python depend on hostpython
Read sdl recipe
Module sdl depend on python
Ignored python, already processed
Ignored sdl, already processed
Ignored pygame, already processed
Read hostpython recipe
Ignored python, already processed
Modules changed to hostpython python sdl pygame pyjnius android kivy
Pure-Python modules changed to
Run get packages
Download package for hostpython
Module hostpython already downloaded
Download package for python
Module python already downloaded
Download package for sdl
No package for sdl
Download package for pygame
Module pygame already downloaded
Download package for pyjnius
Module pyjnius already downloaded
Download package for android
No package for android
Download package for kivy
Module kivy already downloaded
Run prebuild
Call prebuild_hostpython
Call prebuild_python
Call prebuild_sdl
Call prebuild_pygame
Call prebuild_pyjnius
Call prebuild_android
Call prebuild_kivy
Run build
Skipped build_hostpython
Skipped build_python
Skipped build_sdl
Call build_pygame
Entering in ARM environment
Compiler found at /home/kedia-abhishek/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin//arm-linux-androideabi-gcc
running install
running build
running build_py
running build_ext
building 'pygame.imageext' extension
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kedia-abhishek/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/kedia-abhishek/.buildozer/android/platform/android-ndk-r9c/platforms/android-14/arch-arm -I/home/kedia-abhishek/Desktop/buildozer/.buildozer/android/platform/python-for-android/src/jni/png -I/home/kedia-abhishek/Desktop/buildozer/.buildozer/android/platform/python-for-android/src/jni/jpeg -I/home/kedia-abhishek/Desktop/buildozer/.buildozer/android/platform/python-for-android/src/jni/sdl/include -I/home/kedia-abhishek/Desktop/buildozer/.buildozer/android/platform/python-for-android/src/jni/sdl_mixer -I/home/kedia-abhishek/Desktop/buildozer/.buildozer/android/platform/python-for-android/src/jni/sdl_ttf -I/home/kedia-abhishek/Desktop/buildozer/.buildozer/android/platform/python-for-android/src/jni/sdl_image -fPIC -D_REENTRANT -I/usr/include/python2.7 -c src/imageext.c -o build/temp.linux-x86_64-2.7/src/imageext.o
In file included from /usr/include/python2.7/Python.h:8:0,
from src/pygame.h:75,
from src/imageext.c:47:
/usr/include/python2.7/pyconfig.h:15:52: fatal error: arm-linux-gnueabi/python2.7/pyconfig.h: No such file or directory
# include <arm-linux-gnueabi/python2.7/pyconfig.h>
^
compilation terminated.
error: command 'arm-linux-androideabi-gcc' failed with exit status 1
# Command failed: ./distribute.sh -m "kivy" -d "helloworldapp"
#
# 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
NOTE:
I am running Ubuntu 14.04.3 LTS.
I followed this tutorial and installed all the necessary dependencies as mentioned there.
Many forums suggested that I install "python-dev" or "python2.7-dev". Done that, but of no help.
This is probably not the best answer, but till a knowledgable person gives a better answer, I am keeping this as a placeholder.
You may want to try enabling multiarch, install python-dev and python2.7-dev for the architecture "arm-linux-gnueabi"

Error "Unable to find Compiler" using buildozer with Python and Kivy

i want to compile my kivy app into an android apk but get an Error:
:~/kivyapps$ buildozer android debug
# Check configuration tokens
# Ensure build layout
# Create directory .buildozer
# Create directory bin
# Create directory /home/stefan/kivyapps/.buildozer/applibs
# Create directory .buildozer/android/platform
# Create directory .buildozer/android/app
# Check configuration tokens
# Read available permissions from api-versions.xml
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian »dpkg« Paketmanagement-Programm Version 1.16.12 (i386).
Dies ist freie Software; lesen Sie die GNU General Public License in der
Version 2 oder höher für Kopierbedingungen. Es wird KEINE Haftung übernommen.
# Search for Git git
# -> found at /usr/bin/git
# Search for Cython cython
# -> found at /usr/local/bin/cython
# Search for Java compiler
# -> found at /usr/lib/jvm/java-7-openjdk-i386/bin/javac
# Search for Java keytool
# -> found at /usr/lib/jvm/java-7-openjdk-i386/jre/bin/keytool
# Install platform
# Run 'git clone git://github.com/kivy/python-for-android'
# Cwd /home/stefan/kivyapps/.buildozer/android/platform
Cloning into 'python-for-android'...
# Apache ANT found at /home/stefan/.buildozer/android/platform/apache-ant-1.8.4
# Android SDK found at /home/stefan/.buildozer/android/platform/android-sdk-21
# Android NDK found at /home/stefan/.buildozer/android/platform/android-ndk-r9c
# Android packages already installed.
# Check application requirements
# Run './distribute.sh -l'
# Cwd /home/stefan/kivyapps/.buildozer/android/platform/python-for-android
Available modules: android audiostream c_igraph cymunk django docutils ffmpeg gevent greenlet hostpython igraph jpeg kivy libevent libxml2 libxslt lxml msgpack mysql_connector numpy openssl paramiko pil plyer png pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python sdl setuptools sqlalchemy sqlite3 twisted txws wokkel zope
# Remove directory and subdirectory /home/stefan/kivyapps/.buildozer/applibs
# Create directory /home/stefan/kivyapps/.buildozer/applibs
# Compile platform
# Run './distribute.sh -l'
# Cwd /home/stefan/kivyapps/.buildozer/android/platform/python-for-android
Available modules: android audiostream c_igraph cymunk django docutils ffmpeg gevent greenlet hostpython igraph jpeg kivy libevent libxml2 libxslt lxml msgpack mysql_connector numpy openssl paramiko pil plyer png pyasn1 pycrypto pygame pyjnius pylibpd pyopenssl pyparsing pyqrcode python sdl setuptools sqlalchemy sqlite3 twisted txws wokkel zope
# Clean and build python-for-android
# Run './distribute.sh -m "kivy" -d "test"'
# Cwd /home/stefan/kivyapps/.buildozer/android/platform/python-for-android
Check build dependencies for Debian
Check enviromnent
SDK located at /home/stefan/.buildozer/android/platform/android-sdk-21
NDK located at /home/stefan/.buildozer/android/platform/android-ndk-r9c
NDK version is r9c
API level set to 14
Check mandatory tools
Distribution will be located at /home/stefan/kivyapps/.buildozer/android/platform/python- for-android/dist/test
Entering in ARM enviromnent
Unable to find compiler (arm-linux-androideabi-gcc) !!
1. Ensure that SDK/NDK paths are correct
2. Ensure that you've the Android API 14 SDK Platform (via android tool)
# Command failed: ./distribute.sh -m "kivy" -d "test"
I already looked for this error message but could´t find any solution for this problem.
Any tips how to solve this problem?
Im using debian 32bit.
I know that the question is a bit old, but:
export ANDROIDSDK="/path/to/android-sdk-linux"
export ANDROIDNDK="/path/to/android-ndk-rY" #change Y here
export ANDROIDNDKVER=rY #same here
export ANDROIDAPI=X #change X here
export PATH=$PATH:$ANDROIDNDK:$ANDROIDSDK/platform-tools:$ANDROIDSDK/tools
You have to change Y with the ndk version, and X with the API id.
You can add this to your ~/.bashrc.
It solve the problem for me.

Categories

Resources