Trying to build android apk with python3

1,485 views
Skip to first unread message

Hari Kumar Mindi

unread,
Jan 5, 2019, 10:22:06 AM1/5/19
to Kivy users support
I prefer writing code in python3 and really enjoyed learning kivy writing good gui for my python code. I am really struggling to create an apk for my python code. Below are few things i tried:
1. Downloaded builder vm image and tried to use it to create an apk. I think this supports only python2 but i really need to have it working with python3.
2. I created another ubuntu 18.04 vm image on my windows laptop, created an environment for python 3 and installed all the requirements for buildozer.
3. My python code initiated camera with opencv, hence i included that in the buildozer.spec file
4. Buildozer to work with python3, it was mentioned that it works with NDK14b and SDK 20/API 24. Hence the same was mentioned in the buildozer.spec file
However when i try to run the comand buildozer -v android debug it fails with the below message.
[WARNING]: Requested API target 24 is not available, install it with the SDK android tool.
[WARNING]: Exiting.
# Command failed: /home/python/my_py3/bin/python3 -m pythonforandroid.toolchain create --dist_name=camapp --bootstrap=sdl2 --requirements=python3,kivy,cv2,opencv --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/python/Kivy/python3/KivyCamera/.buildozer/android/platform/build"
# 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

Any help with building my first apk will be greatly appreciated.

Ish Rash

unread,
Jan 5, 2019, 11:42:40 AM1/5/19
to Kivy users support
Try Kivy Complete VM 0.5 , I think you might have to download crystax-ndk-10.3.2, I dont think it comes with 0.5
requirements 
= python3crystax==3.5, kivy==1.10.1, plyer, android
android
.api = 19
android
.minapi = 19
android
.sdk = 23
android
.ndk_path = /home/kivy/Android/crystax-ndk-10.3.2/
p4a.branch = master

try the touchtracer example for python3 - /home/kivy/Repos/python3/kivy/examploes/demo/touchtracer/

Hari Kumar Mindi

unread,
Jan 6, 2019, 4:35:46 AM1/6/19
to Kivy users support
Hi,

Thank you for the VM suggestions. I downloaded used the VM and fired it up the image. According the Readme file on the desktop it was mentioned that crystax is not required and the standard package supports python 3. Hence using the buildozer.spec file as template i used similar options on my buildozer.spec file and tried to build the apk with the command "buildozer android debug". However i am getting the below error:

  STDERR:

# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=camapp --bootstrap=sdl2 --requirements=python3,kivy==1.10.1,cv2 --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/kivy/Projects/Camera/.buildozer/android/platform/build"
# 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

Ish Rash

unread,
Jan 6, 2019, 5:26:05 AM1/6/19
to Kivy users support
Please post the full log

Hari Kumar Mindi

unread,
Jan 6, 2019, 7:16:50 AM1/6/19
to Kivy users support
Here is the full log

# 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.18.4 (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-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
# Install platform
# Run '/usr/bin/python -m pip install -q --user \'appdirs\' \'colorama>=0.3.3\' \'jinja2\' \'six\' \'enum34; python_version<"3.4"\' \'sh>=1.10; sys_platform!="nt"\''
# Cwd None
# Apache ANT found at /home/kivy/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/kivy/Android/android-sdk-28
# Android NDK found at /home/kivy/Android/android-ndk-r16b
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=camapp --bootstrap=sdl2 --requirements=python3,kivy==1.10.1,cv2 --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/kivy/Projects/Camera/.buildozer/android/platform/build"'
# Cwd /home/kivy/Repos/python-for-android/
[INFO]:    Recipe kivy: version "1.10.1" requested
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI: 27
[INFO]:    Available Android APIs are (13, 19, 21, 26, 27)
[INFO]:    Requested API target 27 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK: /home/kivy/Android/android-ndk-r16b
[INFO]:    Got NDK version from $ANDROIDNDKVER: r9c
[WARNING]: NDK API target was not set manually, using the default of 21 = min(android-api=27, default ndk-api=21)
[INFO]:    Using Google NDK r9c
[INFO]:    Found virtualenv at /usr/local/bin/virtualenv
[INFO]:    ccache is missing, the build will not be optimized in the future.
[INFO]:    Found the following toolchain versions: ['4.9']
[INFO]:    Picking the latest gcc toolchain, here 4.9
[INFO]:    No existing dists meet the given requirements!
[INFO]:    No dist exists that meets your requirements, so one will be built.
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import TargetPythonRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import shprint, current_directory
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.logger import logger, info, error
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3/__init__.py:4: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.util import ensure_dir, walk_valid_filens
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3/__init__.py:5: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os.path import exists, join, dirname
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3/__init__.py:6: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os import environ
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3/__init__.py:7: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import glob
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3/__init__.py:8: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/hostpython3/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import Recipe, shprint, info
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/hostpython3/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.util import ensure_dir, current_directory
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/hostpython3/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os.path import join, exists
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/hostpython3/__init__.py:4: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/kivy/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import CythonRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/kivy/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import current_directory, shprint
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/kivy/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os.path import exists, join, basename
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/kivy/__init__.py:4: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/kivy/__init__.py:5: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import glob
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pyjnius/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import CythonRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pyjnius/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import shprint, current_directory, info
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pyjnius/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.patching import will_build
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pyjnius/__init__.py:4: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pyjnius/__init__.py:5: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os.path import join
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/six/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import PythonRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python2/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import TargetPythonRecipe, Recipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python2/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import shprint, current_directory, info
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python2/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.patching import (is_darwin, is_api_gt,
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python2/__init__.py:5: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os.path import exists, join, realpath
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python2/__init__.py:6: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os import walk
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python2/__init__.py:7: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import glob
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python2/__init__.py:8: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3crystax/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import TargetPythonRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3crystax/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import shprint
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3crystax/__init__.py:4: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.logger import info, error
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3crystax/__init__.py:5: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.util import ensure_dir, temp_directory
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3crystax/__init__.py:6: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os.path import exists, join
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/python3crystax/__init__.py:7: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/genericndkbuild/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import BootstrapNDKRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/genericndkbuild/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import current_directory, shprint
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/genericndkbuild/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/sdl2/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import BootstrapNDKRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/sdl2/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import current_directory, shprint
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/sdl2/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/sdl/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import BootstrapNDKRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/sdl/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import current_directory, info, shprint
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/sdl/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os.path import exists, join
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/sdl/__init__.py:4: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/sdl2_image/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import BootstrapNDKRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/sdl2_image/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.patching import is_arch
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/sdl2_mixer/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import BootstrapNDKRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/sdl2_ttf/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import BootstrapNDKRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pygame_bootstrap_components/__init__.py:1: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import BootstrapNDKRecipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pygame_bootstrap_components/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import current_directory, shprint, info
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pygame_bootstrap_components/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os.path import exists, join
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pygame_bootstrap_components/__init__.py:4: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pygame_bootstrap_components/__init__.py:5: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import glob
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pygame/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.recipe import Recipe
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pygame/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.util import current_directory, ensure_dir
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pygame/__init__.py:4: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.logger import debug, shprint, info, warning
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pygame/__init__.py:5: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os.path import join
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pygame/__init__.py:6: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/pygame/__init__.py:7: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import glob
[INFO]:    Found a single valid recipe set: [u'cv2', 'hostpython3', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', u'python3', 'sdl2', 'six', 'pyjnius', u'kivy']
[INFO]:    The selected bootstrap is sdl2
[INFO]:    # Creating dist with sdl2 bootstrap
[INFO]:    Dist will have name camapp and recipes (python3, kivy, cv2)
[INFO]:    Dist will also contain modules (cv2) installed from pip
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Recipe build order is ['hostpython3', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', u'python3', 'sdl2', 'six', 'pyjnius', u'kivy']
[INFO]:    The requirements (cv2) were not found as recipes, they will be installed with pip.
[INFO]:    # Downloading recipes 
[INFO]:    Downloading hostpython3
[INFO]:    -> running mkdir -p /home/kivy/Projects/C...(and 60 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/packages/hostpython3
[INFO]:    -> running basename https://www.python.org...(and 34 more)
[INFO]:    -> running rm -f .mark-Python-3.7.1.tgz
[INFO]:    Downloading hostpython3 from https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
- Download 98.[INFO]:    -> running touch .mark-Python-3.7.1.tgz               
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Downloading sdl2_image
[INFO]:    -> running mkdir -p /home/kivy/Projects/C...(and 59 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/packages/sdl2_image
[INFO]:    -> running basename https://www.libsdl.or...(and 52 more)
                                                                  [INFO]:    -> running rm -f .mark-SDL2_image-2.0.1.tar.gz
- Download 96.[INFO]:    -> running touch .mark-SDL2_image-2.0.1.tar.gz
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Downloading sdl2_mixer
[INFO]:    -> running mkdir -p /home/kivy/Projects/C...(and 59 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/packages/sdl2_mixer
[INFO]:    -> running basename https://www.libsdl.or...(and 52 more)
[INFO]:    -> running rm -f .mark-SDL2_mixer-2.0.1.tar.gz
- Download 97.0[INFO]:    -> running touch .mark-SDL2_mixer-2.0.1.tar.gz       
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Downloading sdl2_ttf
[INFO]:    -> running mkdir -p /home/kivy/Projects/C...(and 57 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/packages/sdl2_ttf
[INFO]:    -> running basename https://www.libsdl.org...(and 48 more)
[INFO]:    -> running rm -f .mark-SDL2_ttf-2.0.14.tar.gz
- Do[INFO]:    -> running touch .mark-SDL2_ttf-2.0.14.tar.gz                   
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Downloading python3
[INFO]:    -> running mkdir -p /home/kivy/Projects/C...(and 56 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/packages/python3
[INFO]:    -> running basename https://www.python.org...(and 34 more)
[INFO]:    -> running rm -f .mark-Python-3.7.1.tgz
[INFO]:    Downloading python3 from https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
- Download 98.9[INFO]:    -> running touch .mark-Python-3.7.1.tgz              
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Downloading sdl2
[INFO]:    -> running mkdir -p /home/kivy/Projects/C...(and 53 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/packages/sdl2
[INFO]:    -> running basename https://www.libsdl.org...(and 26 more)
[INFO]:    -> running rm -f .mark-SDL2-2.0.4.tar.gz
[INFO]:    Downloading sdl2 from https://www.libsdl.org/release/SDL2-2.0.4.tar.gz
- Do[INFO]:    -> running touch .mark-SDL2-2.0.4.tar.gz                        
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Downloading six
[INFO]:    -> running mkdir -p /home/kivy/Projects/C...(and 52 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/packages/six
[INFO]:    -> running basename https://pypi.python.or...(and 40 more)
[INFO]:    -> running rm -f .mark-six-1.9.0.tar.gz
[INFO]:    -> running touch .mark-six-1.9.0.tar.gz
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Downloading pyjnius
[INFO]:    -> running mkdir -p /home/kivy/Projects/C...(and 56 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/packages/pyjnius
[INFO]:    -> running basename https://github.com/kiv...(and 27 more)
[INFO]:    -> running rm -f .mark-1.1.3.zip
[INFO]:    Downloading pyjnius from https://github.com/kivy/pyjnius/archive/1.1.3.zip
- Do[INFO]:    -> running touch .mark-1.1.3.zip                                
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Downloading kivy
[INFO]:    -> running mkdir -p /home/kivy/Projects/C...(and 53 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/packages/kivy
[INFO]:    -> running basename https://github.com/kiv...(and 25 more)
[INFO]:    -> running rm -f .mark-1.10.1.zip
[INFO]:    Downloading kivy from https://github.com/kivy/kivy/archive/1.10.1.zip
- [INFO]:    -> running touch .mark-1.10.1.zip                                 
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    # Building all recipes for arch armeabi-v7a
[INFO]:    # Unpacking recipes
[INFO]:    Unpacking hostpython3 for armeabi-v7a
[INFO]:    -> running basename https://www.python.org...(and 34 more)
           working: Python-3.7.1.tgz                       [INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop
[INFO]:    -> running tar tf /home/kivy/Projects/Cam...(and 75 more)
           working: Python-3.7.1/Objects/methodobject.[INFO]:    -> running mv Python-3.7.1 /home/kivy/Pro...(and 97 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Unpacking sdl2_image for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.or...(and 52 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni
[INFO]:    -> running tar tf /home/kivy/Projects/Cam...(and 81 more)
           working: SDL2_image-2.0.1/aci[INFO]:    -> running mv SDL2_image-2.0.1 /home/kivy...(and 101 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Unpacking sdl2_mixer for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.or...(and 52 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni
[INFO]:    -> running tar tf /home/kivy/Projects/Cam...(and 81 more)
           working: SDL2_mixer-2.0[INFO]:    -> running mv SDL2_mixer-2.0.1 /home/kivy...(and 101 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Unpacking sdl2_ttf for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org...(and 48 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni
[INFO]:    -> running tar tf /home/kivy/Projects/Cam...(and 78 more)
           working: SDL2_ttf-2.0[INFO]:    -> running mv SDL2_ttf-2.0.14 /home/kivy/...(and 98 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Unpacking python3 for armeabi-v7a
[INFO]:    -> running basename https://www.python.org...(and 34 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/python3/armeabi-v7a__ndk_target_21
[INFO]:    -> running tar tf /home/kivy/Projects/Cam...(and 71 more)
           working: Python-3.7.1/Objects/t[INFO]:    -> running mv Python-3.7.1 /home/kivy/Pro...(and 108 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Unpacking sdl2 for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org...(and 26 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni
[INFO]:    -> running tar tf /home/kivy/Projects/Cam...(and 69 more)
           working: SDL2-2.0.4/acinclude[INFO]:    -> running mv SDL2-2.0.4 /home/kivy/Proje...(and 88 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Unpacking six for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.or...(and 40 more)
           working: six-1.9.0.tar.gz                   [INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/six-python3/armeabi-v7a__ndk_target_21
[INFO]:    -> running tar tf /home/kivy/Projects/Cam...(and 67 more)
           working: six-1.9.0/documentation/Makefile                  [INFO]:    -> running mv six-1.9.0 /home/kivy/Projec...(and 105 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Unpacking pyjnius for armeabi-v7a
[INFO]:    -> running basename https://github.com/kiv...(and 27 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21
[INFO]:    -> running mv pyjnius-1.1.3 /home/kivy/Pr...(and 122 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Unpacking kivy for armeabi-v7a
[INFO]:    -> running basename https://github.com/kiv...(and 25 more)
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/kivy-python3-sdl2/armeabi-v7a__ndk_target_21
[INFO]:    -> running mv kivy-1.10.1 /home/kivy/Proj...(and 114 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython3 for armeabi-v7a
[INFO]:    hostpython3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding sdl2_image for armeabi-v7a
[INFO]:    sdl2_image has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_image[armeabi-v7a]
[INFO]:    Applying patch toggle_jpg_png_webp.patch
[INFO]:    -> running patch -t -d /home/kivy/Project...(and 198 more)
[INFO]:    Applying patch extra_cflags.patch
[INFO]:    -> running patch -t -d /home/kivy/Project...(and 191 more)
[INFO]:    Applying patch fix_with_ndk_15_plus.patch
[INFO]:    -> running patch -t -d /home/kivy/Project...(and 199 more)
[INFO]:    -> running touch /home/kivy/Projects/Came...(and 96 more)
[INFO]:    Prebuilding sdl2_mixer for armeabi-v7a
[INFO]:    sdl2_mixer has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2_mixer[armeabi-v7a]
[INFO]:    Applying patch toggle_modplug_mikmod_smpeg_ogg.patch
[INFO]:    -> running patch -t -d /home/kivy/Project...(and 210 more)
[INFO]:    -> running touch /home/kivy/Projects/Came...(and 96 more)
[INFO]:    Prebuilding sdl2_ttf for armeabi-v7a
[INFO]:    sdl2_ttf has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding python3 for armeabi-v7a
[INFO]:    python3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding sdl2 for armeabi-v7a
[INFO]:    sdl2 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sdl2[armeabi-v7a]
[INFO]:    Applying patch add_nativeSetEnv.patch
[INFO]:    -> running patch -t -d /home/kivy/Project...(and 182 more)
[INFO]:    -> running touch /home/kivy/Projects/Came...(and 89 more)
[INFO]:    Prebuilding six for armeabi-v7a
[INFO]:    six has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding pyjnius for armeabi-v7a
[INFO]:    pyjnius has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for pyjnius[armeabi-v7a]
[INFO]:    Applying patch sdl2_jnienv_getter.patch
[INFO]:    -> running patch -t -d /home/kivy/Project...(and 218 more)
          [INFO]:    -> running touch /home/kivy/Projects/Came...(and 120 more)
[INFO]:    Prebuilding kivy for armeabi-v7a
[INFO]:    kivy has no prebuild_armeabi_v7a, skipping
[INFO]:    # Building recipes
[INFO]:    Building hostpython3 for armeabi-v7a
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/native-build
[INFO]:    -> running configure
           wo[INFO]:    <- directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3
[INFO]:    -> running cp Modules/Setup.dist /home/ki...(and 130 more)
[INFO]:    -> running make -C /home/kivy/Projects/Ca...(and 102 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-androidd 503 more) 
[INFO]:    Building sdl2_image for armeabi-v7a
[INFO]:    Building sdl2_mixer for armeabi-v7a
[INFO]:    Building sdl2_ttf for armeabi-v7a
[INFO]:    Building python3 for armeabi-v7a
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/android-build
[WARNING]: Doing some hacky stuff to link properly
[INFO]:    -> running cp /home/kivy/Android/android-...(and 63 more)
[INFO]:    -> running cp /home/kivy/Android/android-...(and 61 more)
[INFO]:    -> running configure --host=arm-linux-and...(and 211 more)
           working:[INFO]:    -> running make allpython.pc                     
  [INFO]:    <- directory context /home/kivy/Repos/python-for-android464 more) 
[INFO]:    Building sdl2 for armeabi-v7a
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/hostpython2/__init__.py:2: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from pythonforandroid.toolchain import Recipe, shprint, current_directory, info, warning
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/hostpython2/__init__.py:3: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  from os.path import join, exists
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/hostpython2/__init__.py:4: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import os
/home/kivy/Repos/python-for-android/pythonforandroid/recipes/hostpython2/__init__.py:5: RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import
  import sh
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni
[INFO]:    -> running ndk-build V=1
           working: 1[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Building six for armeabi-v7a
[INFO]:    six apparently isn't already in site-packages
[INFO]:    Installing six into site-packages
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/six-python3/armeabi-v7a__ndk_target_21/six
[INFO]:    -> running python setup.py install -O2 --...(and 110 more)
           working: copying six.py -[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Building pyjnius for armeabi-v7a
[INFO]:    jnius apparently isn't already in site-packages
[INFO]:    Cythonizing anything necessary in pyjnius
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]:    -> running python -c import sys; print(sys.path)
                                                   [INFO]:    Trying first build of pyjnius to get cython files: this is expected to fail
[INFO]:    -> running python setup.py build_ext -v
('cwd is', '/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21/pyjnius')
Exception in thread background thread for pid 21954:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 2170, in background_thread
    handle_exit_code(exit_code)
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 1929, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
ErrorReturnCode_1: 

  RAN: /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/native-build/python setup.py build_ext -v

  STDOUT:
/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/Lib/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
running build_ext
building 'jnius' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/jnius
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=21 -isystem /home/kivy/Android/android-ndk-r16b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/kivy/Android/android-ndk-r16b/sysroot -I/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/python-installs/camapp/include/python3.7 -DNDEBUG -g -fwrapv -O3 -Wall -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=21 -isystem /home/kivy/Android/android-ndk-r16b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/kivy/Android/android-ndk-r16b/sysroot -I/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/python-installs/camapp/include/python3.7 -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -I/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -fPIC -I/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/native-build -c jnius/jnius.c -o build/temp.linux-x86_64-3.7/jnius/jnius.o
arm-linux-androideabi-gcc: error: jnius/jnius.c: No such file or directory
arm-linux-androideabi-gcc: fatal error: no input files
compilation terminated.
error: command 'arm-linux-androideabi-gcc' failed with exit status 1


  STDERR:


           [INFO]:    pyjnius first build failed (as expected)...(and 26 more) 
[INFO]:    Running cython where appropriate
[INFO]:    Cythonize jnius/jnius.pyx
[INFO]:    -> running cython ./jnius/jnius.pyx
()                                                                  
[INFO]:    -> running python setup.py build_ext -v
           working: jnius/[INFO]:    Stripping object files       ^            
[INFO]:    -> running find . -iname *.so -exec /usr/bin/echo {} ;
[INFO]:    -> running find . -iname *.so -exec arm-li...(and 43 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Installing pyjnius into site-packages
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]:    -> running python setup.py install -O2 --...(and 110 more)
           working: copying build/lib.linux-x86_64-3.7/jnius/...(and 111[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Building kivy for armeabi-v7a
[INFO]:    kivy apparently isn't already in site-packages
[INFO]:    Cythonizing anything necessary in kivy
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/kivy-python3-sdl2/armeabi-v7a__ndk_target_21/kivy
[INFO]:    -> running python -c import sys; print(sys.path)
   [INFO]:    Trying first build of kivy to get cython files: this is expected to fail
[INFO]:    -> running python setup.py build_ext -v
('cwd is', '/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/kivy-python3-sdl2/armeabi-v7a__ndk_target_21/kivy')
           working: Updated kivy/include/coException in thread background thread for pid 22027:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 2170, in background_thread
    handle_exit_code(exit_code)
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 1929, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
ErrorReturnCode_1: 

  RAN: /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/native-build/python setup.py build_ext -v

  STDOUT:
Using distutils
Environ change use_sdl2 -> True

Cython check avoided.
Using this graphics system: OpenGL ES 2
SDL2 found via pkg-config
SDL2: found SDL header at /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL/include/SDL.h
SDL2: found SDL_mixer header at /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/SDL_mixer.h
SDL2: found SDL_ttf header at /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_ttf/SDL_ttf.h
SDL2: found SDL_image header at /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python3/jni/SDL2_image/SDL_image.h
fatal: Not a git repository (or any of the parent directories): .git
 /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/Lib/distutils/dist.py:274: UserWarning: Unknown distribution option: 'dependency_links'
   warnings.warn(msg)
 /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/Lib/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
   warnings.warn(msg)
 /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/Lib/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extra_requires'
   warnings.warn(msg)
 /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/Lib/distutils/dist.py:274: UserWarning: Unknown distribution option: 'setup_requires'
   warnings.warn(msg)
running build_ext
Build configuration is:
 * use_rpi = 0
 * use_mali = 0
 * use_egl = 0
 * use_opengl_es2 = 1
 * use_opengl_mock = 0
 * use_sdl2 = 1
 * use_ios = 0
 * use_mesagl = 0
 * use_x11 = 0
 * use_wayland = 0
 * use_gstreamer = 0
 * use_avfoundation = 0
 * use_osx_frameworks = 0
 * debug_gl = 0
 * debug = False
Updated kivy/include/config.h
Updated kivy/include/config.pxi
Updated kivy/setupconfig.py
Detected compiler is unix
building 'kivy._event' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/kivy
arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=21 -isystem /home/kivy/Android/android-ndk-r16b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/kivy/Android/android-ndk-r16b/sysroot -I/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/python-installs/camapp/include/python3.7 -DNDEBUG -g -fwrapv -O3 -Wall -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=21 -isystem /home/kivy/Android/android-ndk-r16b/sysroot/usr/include/arm-linux-androideabi -isysroot /home/kivy/Android/android-ndk-r16b/sysroot -I/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/python-installs/camapp/include/python3.7 -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -I/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Include -fPIC -Ikivy/include -I/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/native-build -c kivy/_event.c -o build/temp.linux-x86_64-3.7/kivy/_event.o
arm-linux-androideabi-gcc: error: kivy/_event.c: No such file or directory
arm-linux-androideabi-gcc: fatal error: no input files
compilation terminated.
 error: command 'arm-linux-androideabi-gcc' failed with exit status 1


  STDERR:


                                                           [INFO]:    kivy first build failed (as expected)
[INFO]:    Running cython where appropriate
[INFO]:    Cythonize kivy/weakproxy.pyx
[INFO]:    -> running cython ./kivy/weakproxy.pyx
()                  
[INFO]:    Cythonize kivy/_event.pyx
[INFO]:    -> running cython ./kivy/_event.pyx
[INFO]:    Cythonize kivy/_clock.pyx
[INFO]:    -> running cython ./kivy/_clock.pyx
[INFO]:    Cythonize kivy/properties.pyx
[INFO]:    -> running cython ./kivy/properties.pyx
[INFO]:    Cythonize kivy/lib/gstplayer/_gstplayer.pyx
[INFO]:    -> running cython ./kivy/lib/gstplayer/_gstplayer.pyx
       [INFO]:    Cythonize kivy/lib/vidcore_lite/egl.pyx                      
[INFO]:    -> running cython ./kivy/lib/vidcore_lite/egl.pyx
[INFO]:    Cythonize kivy/lib/vidcore_lite/bcm.pyx
[INFO]:    -> running cython ./kivy/lib/vidcore_lite/bcm.pyx
[INFO]:    Cythonize kivy/graphics/vertex.pyx
[INFO]:    -> running cython ./kivy/graphics/vertex.pyx
[INFO]:    Cythonize kivy/graphics/opengl.pyx
[INFO]:    -> running cython ./kivy/graphics/opengl.pyx
           working:[INFO]:    Cythonize kivy/graphics/buffer.pyx               
[INFO]:    -> running cython ./kivy/graphics/buffer.pyx
[INFO]:    Cythonize kivy/graphics/gl_instructions.pyx
[INFO]:    -> running cython ./kivy/graphics/gl_instructions.pyx
[INFO]:    Cythonize kivy/graphics/svg.pyx
[INFO]:    -> running cython ./kivy/graphics/svg.pyx
[INFO]:    Cythonize kivy/graphics/shader.pyx
[INFO]:    -> running cython ./kivy/graphics/shader.pyx
           working: /usr/local/[INFO]:    Cythonize kivy/graphics/vertex_instructions.pyx
[INFO]:    -> running cython ./kivy/graphics/vertex_instructions.pyx
[INFO]:    Cythonize kivy/graphics/scissor_instructions.pyx
[INFO]:    -> running cython ./kivy/graphics/scissor_instructions.pyx
[INFO]:    Cythonize kivy/graphics/opengl_utils.pyx
[INFO]:    -> running cython ./kivy/graphics/opengl_utils.pyx
[INFO]:    Cythonize kivy/graphics/transformation.pyx
[INFO]:    -> running cython ./kivy/graphics/transformation.pyx
           working: /usr/local/lib/python2.[INFO]:    Cythonize kivy/graphics/texture.pyx
[INFO]:    -> running cython ./kivy/graphics/texture.pyx
[INFO]:    Cythonize kivy/graphics/context.pyx
[INFO]:    -> running cython ./kivy/graphics/context.pyx
[INFO]:    Cythonize kivy/graphics/tesselator.pyx
[INFO]:    -> running cython ./kivy/graphics/tesselator.pyx
[INFO]:    Cythonize kivy/graphics/vbo.pyx
[INFO]:    -> running cython ./kivy/graphics/vbo.pyx
           working: /usr/local/lib/python2.7/dist-packa[INFO]:    Cythonize kivy/graphics/cgl.pyx
[INFO]:    -> running cython ./kivy/graphics/cgl.pyx
[INFO]:    Cythonize kivy/graphics/context_instructions.pyx
[INFO]:    -> running cython ./kivy/graphics/context_instructions.pyx
[INFO]:    Cythonize kivy/graphics/instructions.pyx
[INFO]:    -> running cython ./kivy/graphics/instructions.pyx
           working: warning: kivy/graphics/common.pxi:23:4: 'size_t'[INFO]:    Cythonize kivy/graphics/fbo.pyx
[INFO]:    -> running cython ./kivy/graphics/fbo.pyx
[INFO]:    Cythonize kivy/graphics/compiler.pyx
[INFO]:    -> running cython ./kivy/graphics/compiler.pyx
[INFO]:    Cythonize kivy/graphics/stencil_instructions.pyx
[INFO]:    -> running cython ./kivy/graphics/stencil_instructions.pyx
[INFO]:    Cythonize kivy/graphics/cgl_backend/cgl_glew.pyx
[INFO]:    -> running cython ./kivy/graphics/cgl_backend/cgl_glew.pyx
           working:   tree = Parsing.p_module(s, pxd, full_module_name)        [INFO]:    Cythonize kivy/graphics/cgl_backend/cgl_mock.pyx
[INFO]:    -> running cython ./kivy/graphics/cgl_backend/cgl_mock.pyx
[INFO]:    Cythonize kivy/graphics/cgl_backend/cgl_gl.pyx
[INFO]:    -> running cython ./kivy/graphics/cgl_backend/cgl_gl.pyx
[INFO]:    Cythonize kivy/graphics/cgl_backend/cgl_sdl2.pyx
[INFO]:    -> running cython ./kivy/graphics/cgl_backend/cgl_sdl2.pyx
[INFO]:    Cythonize kivy/graphics/cgl_backend/cgl_debug.pyx
[INFO]:    -> running cython ./kivy/graphics/cgl_backend/cgl_debug.pyx
        [INFO]:    Cythonize kivy/core/clipboard/_clipboard_sdl2.pyxme)        
[INFO]:    -> running cython ./kivy/core/clipboard/_clipboard_sdl2.pyx
[INFO]:    Cythonize kivy/core/image/_img_sdl2.pyx
[INFO]:    -> running cython ./kivy/core/image/_img_sdl2.pyx
[INFO]:    Cythonize kivy/core/image/img_imageio.pyx
[INFO]:    -> running cython ./kivy/core/image/img_imageio.pyx
[INFO]:    Cythonize kivy/core/text/_text_sdl2.pyx
[INFO]:    -> running cython ./kivy/core/text/_text_sdl2.pyx
           working: [INFO]:    Cythonize kivy/core/text/text_layout.pyx0 more) 
[INFO]:    -> running cython ./kivy/core/text/text_layout.pyx
[INFO]:    Cythonize kivy/core/audio/audio_sdl2.pyx
[INFO]:    -> running cython ./kivy/core/audio/audio_sdl2.pyx
[INFO]:    Cythonize kivy/core/window/window_info.pyx
[INFO]:    -> running cython ./kivy/core/window/window_info.pyx
[INFO]:    Cythonize kivy/core/window/_window_sdl2.pyx
[INFO]:    -> running cython ./kivy/core/window/_window_sdl2.pyx
           working:   tree = Par[INFO]:    Cythonize kivy/core/camera/camera_avfoundation.pyx
[INFO]:    -> running cython ./kivy/core/camera/camer...(and 18 more)
[INFO]:    -> directory context .
[INFO]:    <- directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/kivy-python3-sdl2/armeabi-v7a__ndk_target_21/kivy
[INFO]:    -> running python setup.py build_ext -v
           working: arm-linux-androide[INFO]:    Stripping object filesoard    
[INFO]:    -> running find . -iname *.so -exec /usr/bin/echo {} ;
 [INFO]:    -> running find . -iname *.so -exec arm-li...(and 43 more)rectory  
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Installing kivy into site-packages
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/kivy-python3-sdl2/armeabi-v7a__ndk_target_21/kivy
[INFO]:    -> running python setup.py install -O2 --...(and 110 more)
           working: byte-com[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    # Biglinking object files
[INFO]:    Collating object files from each recipe
[INFO]:    hostpython3 recipe has no biglinkable files dir, skipping
[INFO]:    sdl2_image recipe has no biglinkable files dir, skipping
[INFO]:    sdl2_mixer recipe has no biglinkable files dir, skipping
[INFO]:    sdl2_ttf recipe has no biglinkable files dir, skipping
[INFO]:    python3 recipe has no biglinkable files dir, skipping
[INFO]:    sdl2 recipe has no biglinkable files dir, skipping
[INFO]:    six recipe has no biglinkable files dir, skipping
[INFO]:    pyjnius recipe has no biglinkable files, skipping
[INFO]:    kivy recipe has no biglinkable files, skipping
[INFO]:    There seem to be no libraries to biglink, skipping.
[INFO]:    # Postbuilding recipes
[INFO]:    Postbuilding hostpython3 for armeabi-v7a
[INFO]:    Postbuilding sdl2_image for armeabi-v7a
[INFO]:    Postbuilding sdl2_mixer for armeabi-v7a
[INFO]:    Postbuilding sdl2_ttf for armeabi-v7a
[INFO]:    Postbuilding python3 for armeabi-v7a
[INFO]:    Postbuilding sdl2 for armeabi-v7a
[INFO]:    Postbuilding six for armeabi-v7a
[INFO]:    Postbuilding pyjnius for armeabi-v7a
[INFO]:    Copying pyjnius java class to classes build dir
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]:    -> running cp -a jnius/src/org /home/kivy...(and 75 more)
[INFO]:    <- directory context /home/kivy/Repos/python-for-android
[INFO]:    Postbuilding kivy for armeabi-v7a
[INFO]:    # Installing pure Python modules
[INFO]:    The requirements (cv2) don't have recipes, attempting to install them with pip
[INFO]:    If this fails, it may mean that the module has compiled components and needs a recipe.
[INFO]:    -> directory context /home/kivy/Projects/Camera/.buildozer/android/platform/build/build
[INFO]:    -> running virtualenv --python=python3.7 venv
           working: The path python3.7 (froException in thread background thread for pid 23043:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 2170, in background_thread
    handle_exit_code(exit_code)
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 1929, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
ErrorReturnCode_3: 

  RAN: /usr/local/bin/virtualenv --python=python3.7 venv

  STDOUT:
The path python3.7 (from --python=python3.7) does not exist


  STDERR:


Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/kivy/Repos/python-for-android/pythonforandroid/toolchain.py", line 1033, in <module>
    main()
  File "/home/kivy/Repos/python-for-android/pythonforandroid/toolchain.py", line 1029, in main
    ToolchainCL()
  File "/home/kivy/Repos/python-for-android/pythonforandroid/toolchain.py", line 551, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/kivy/Repos/python-for-android/pythonforandroid/toolchain.py", line 149, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/kivy/Repos/python-for-android/pythonforandroid/toolchain.py", line 189, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "pythonforandroid/build.py", line 662, in build_recipes
  File "pythonforandroid/build.py", line 683, in run_pymodules_install
  File "pythonforandroid/logger.py", line 178, in shprint
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 720, in next
    self.wait()
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 651, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/kivy/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_3: 

  RAN: /usr/local/bin/virtualenv --python=python3.7 venv

  STDOUT:
The path python3.7 (from --python=python3.7) does not exist


  STDERR:

# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=camapp --bootstrap=sdl2 --requirements=python3,kivy==1.10.1,cv2 --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/kivy/Projects/Camera/.buildozer/android/platform/build"
# 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


On Sunday, January 6, 2019 at 10:26:05 AM UTC, Ish Rash wrote:
Please post the full log

Глеб Самойлов

unread,
Jan 6, 2019, 7:27:44 AM1/6/19
to kivy-...@googlegroups.com
Python-for-Android is broken! You will not build a package with any dependencies, except Python and Kivy!

вс, 6 янв. 2019 г. в 15:16, Hari Kumar Mindi <harikum...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To post to this group, send email to kivy-...@googlegroups.com.
Visit this group at https://groups.google.com/group/kivy-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/de143f72-4212-43bd-b645-b5f953d330b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hari Kumar Mindi

unread,
Jan 6, 2019, 7:34:47 AM1/6/19
to Kivy users support
So I cannot build an apk from program that has dependencies on other python libraries, is it?
...

Глеб Самойлов

unread,
Jan 6, 2019, 7:36:09 AM1/6/19
to kivy-...@googlegroups.com
Yes.

вс, 6 янв. 2019 г. в 15:34, Hari Kumar Mindi <harikum...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To post to this group, send email to kivy-...@googlegroups.com.
Visit this group at https://groups.google.com/group/kivy-users.

Hari Kumar Mindi

unread,
Jan 6, 2019, 8:02:30 AM1/6/19
to Kivy users support
Any suggestions to build an apk from kivy python3 which has dependencies on other libraries ?
...

Robert Flatt

unread,
Jan 6, 2019, 4:06:39 PM1/6/19
to Kivy users support
It depends what you mean by "other libraries",
The answer depends if the library is written in Python, Java,  C, or some other compiled language.
And some Python libraries are in part written in C, which seems to be a cause of user surprise.

Try this for yourself with VERY SMALL examples.

Pure Python (I think) just works
Java is accessed through jnius which requires the option --requirements=pyjnius
System libraries compiled (from C?) for arm architecture during the build is also a --requirement
In the mixed case the compiled code is a requirement, see recent posts about sqlite for an example
Also there is a magic Android only library that is included when --requirements=android

So '--requirements' are 'build requirements" not 'Python requirements'

Hari Kumar Mindi

unread,
Jan 6, 2019, 4:23:41 PM1/6/19
to Kivy users support
The libraries that i mentioned are the python libraries like cv2, imutils, dlib, numpy, scipy etc..
...

Robert Flatt

unread,
Jan 6, 2019, 4:32:07 PM1/6/19
to Kivy users support
Try small examples, one library at a time.

Hari Kumar Mindi

unread,
Jan 6, 2019, 5:07:24 PM1/6/19
to Kivy users support
Here is what i am going to try...
1. Created a python 3 app which starts and stops camera video using cv2.
2. I built a ubuntu 18.04 VM on virtual box
3. Got Buildozer and downloading Android SDK = 28 and NDK = r18b
4. This is what i would put in buildozer.spec file:
requirements = python3,kivy,opencv,android
android.api = 27
android.minapi = 21
android.sdk = 28
android.ndk_path = /home/kivy/Android/android-ndk-r18b/
android.sdk_path = /home/kivy/Android/android-sdk-28/

Copying the files from Host to vm at the moment will take some time. I will see how this works and will post again once it is done.

-Hari Mindi

JC

unread,
Jan 7, 2019, 5:14:06 AM1/7/19
to Kivy users support


if this is on Android, it is a tough challenge. I have not been able to use the camera after more than 4 weeks of research on this...camera seems unreacheable on Android right now.

Hari Kumar Mindi

unread,
Jan 9, 2019, 4:02:01 PM1/9/19
to Kivy users support
Looks like it is never ending for me to make an apk from kivy python.
>>Whatever i tried with python3 i could not get it to work, hence i had got my program to python2.
>>Built a new VM of xubuntu 18.04 and installed all dependencies of buildozer along with buildozer
>>Did not mention anything in buildozer.spec file about SDK and NDK and requirements = python2,kivy,numpy,opencv
>>Initially had a problem not finding sh module, resolved that
>>Now i get another error as below
bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error is not recoverable: exiting now
# Command failed: tar xjf android-ndk-r9c-linux-x86_64.tar.bz2
>>It is trying to download NDK r9c from the link "http://dl.google.com/android/repository/android-ndk-r9c-linux-x86_64.tar.bz2" which is broken.

Not sure if i need to download SDK and NDK and give the path in buildozer.spec file :(

-Hari Mindi

Robert Flatt

unread,
Jan 9, 2019, 7:56:40 PM1/9/19
to Kivy users support
Regardless of the bogus location, it seems Google doesn't distribute any NDK older than "10e".
So if "9c" is the Buildozer default, this is not going to work because it is no longer distributed. Get over it and specify something.

Personally I use "17c", because last time I tried (2 months? ago) "18b" was not supported by p4a/buildozer, I do not know if this is still true.
If you can't get buildozer to work for you, try the Complete VM this is a wrapper around buildozer.
Or what I do, use p4a which is what is inside buildozer (an old post showing my setup, for Python3, NDK):

With regard to numpy and opencv, neither(?) of these are 100% Python. So p4a needs special recipes to build from C(?) [hence requirements]
These recipes exist:
I have no idea if numpy and opencv recipes currently work or not, this is just a comment only on my lack of knowledge.  I notice numpy was updated a few hours ago.
After you get Hello World running, the first thing to try is modify it to import and dir() each of numpy and opencv.

Hari Kumar Mindi

unread,
Jan 11, 2019, 6:33:29 PM1/11/19
to Kivy users support
For the same program which has opencv dependencies, i tried with p4a and it ended up with the below error:
RAN: /usr/bin/patch -t -d /home/python/.local/share/python-for-android/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius -p1 -i /usr/local/lib/python2.7/dist-packages/pythonforandroid/recipes/pyjnius/sdl2_jnienv_getter.patch

  STDOUT:
patching file jnius/jnius_jvm_android.pxi
patching file setup.py
Hunk #1 FAILED at 53.
1 out of 1 hunk FAILED -- saving rejects to file setup.py.rej

Now i tried a simple Helloworld program with buildozer and below are somoe configuration parameters:
requirements = python2,kivy
android.api = 27
android.sdk = 28
android.ndk = 17c
android.sdk_path = /home/python/Documents/android-sdk

Now it failed with the below error:
symbol:   method setLatestEventInfo(Context,String,String,PendingIntent)
  location: variable notification of type Notification
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 48.554 secs


  STDERR:


[INFO]:    STDOUT (last 20 lines of 41):
  symbol:   method setLatestEventInfo(Context,String,String,PendingIntent)
  location: variable notification of type Notification
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 48.554 secs

[INFO]:    STDERR:
[INFO]:    COMMAND:
cd /home/python/Projects/Helloworld/.buildozer/android/platform/build/dists/myapp && ./gradlew assembleDebug

[WARNING]: ERROR: ./gradlew failed!
# Command failed: /usr/bin/python -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2 --dist_name myapp --name 'My Application' --version 0.1 --package org.test.myapp --android_api 27 --minsdk 9 --private /home/python/Projects/Helloworld/.buildozer/android/app --orientation portrait --window --copy-libs --arch armeabi-v7a --color=always --storage-dir="/home/python/Projects/Helloworld/.buildozer/android/platform/build"

Any suggestions please?

Robert Flatt

unread,
Jan 11, 2019, 7:08:00 PM1/11/19
to Kivy users support
I think you are on the right track by trying something simple like HelloWorld first.

1) Try that with p4a , I use Python3, I have no experience with Python2 in this context.

2) "--minsdk 9" seems odd, would have expected something like 19 or 21.  Is ndk-api set?  Or some buildozer setting like that....

You certainly get points for persistence.

Hari Kumar Mindi

unread,
Jan 11, 2019, 8:49:55 PM1/11/19
to Kivy users support
Sure I am going to try that next. My program is mainly based on camera, so would like to know if you had managed to get the camera working in apk ?

Robert Flatt

unread,
Jan 11, 2019, 10:04:06 PM1/11/19
to Kivy users support
I have no experience with Camera.
Probably a good idea to expect challenges ;)
Worst comes to worse there is always jnius.....

Hari Kumar Mindi

unread,
Jan 12, 2019, 8:45:21 PM1/12/19
to Kivy users support
Finally got my first python3 "HelloWorld" apk done.
Now i wanted to test for opencv, hence wrote another simple kivy program which uses opencv. However when i tried to compile i get the below error:


 File "/usr/local/lib/python3.6/dist-packages/sh.py", line 3226, in __getitem__
    raise CommandNotFound(k)
sh.CommandNotFound: cmake

Here is my p4a command:

p4a apk --private . --package=org.example.kivyopencv --name "KivyopenCV application" --version 0.1 --bootstrap=sdl2 --requirements=python3,kivy,numpy,opencv --arch=armeabi-v7a --sdk-dir /home/python/Documents/android-sdk --ndk-dir /home/python/Documents/android-ndk-r17c --android-api 28 --ndk_version 17c --ndk-api 21 --whitelist /home/python/Projects/KivyopenCV/image.txt

Any suggestions please ..?

Ozgur Erkent

unread,
May 5, 2019, 10:01:12 AM5/5/19
to Kivy users support
Hi,

Related to this error, you need to install cmake, probably version 3.6 or higher. Related to camera, I was able to install camera on python2. But it doesn't support cv2 and numpy. You can add them to buildozer.spec requirements, but when you try to even just import them, the problems arise. The suggestion was to use python3. When I used python3, I had to correct the python3 recipe with this code: https://github.com/opacam/python-for-android/commit/efcb66f1b45d24f525a746c4a94d0f1147a1c42a#diff-62af0574da035ee296803d8d5f97ef79 . Then touchtracer worked on python3 as well. However, when I want to include the numpy alone by adding it to the requirements of buildozer.spec, then it says "RuntimeWarning: Parent module 'pythonforandroid.recipes' not found while handling absolute import". I think kivy is for hobbyists who don't work with image processing or numpy arrays. Hard work for creating simple games. I hope it will have more developers to help. Unfortunately the test cases are not running out of box. My suggestion is not to use kivy if you will use camera on android with numpy or any other library if you don't have time to contribute to the development of kivy.
Reply all
Reply to author
Forward
0 new messages