Skip to content

Cannot build APK - IndexError: List index out of range #1774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
myasul opened this issue Mar 28, 2019 · 10 comments
Closed

Cannot build APK - IndexError: List index out of range #1774

myasul opened this issue Mar 28, 2019 · 10 comments

Comments

@myasul
Copy link

myasul commented Mar 28, 2019

Versions

  • Python: 3.6.7
  • OS: Ubuntu 18.04.2 LTS
  • Buildozer:

Description

I tried building my kivy app via buildozer. There are a lot of errors but stackoverflow and previous helped me up to this point. I'm currently stuck. I already tried rebuilding (deleting .buildozer folder then running buildozer -v android debug but I still encounter the same issue. Please advise.

buildozer.spec

Command:

buidozer -v android debug

Spec file:

[app]

# (str) Title of your application
title = EKT Dictionary

# (str) Package name
package.name = ekt_dictionary

# (str) Package domain (needed for android/ios packaging)
package.domain = org.test

# (str) Source code where the main.py live
source.dir = .

# (list) Source files to include (let empty to include all the files)
source.include_exts =

# (list) List of inclusions using pattern matching
#source.include_patterns = assets/*,images/*.png

# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec

# (list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin

# (list) List of exclusions using pattern matching
#source.exclude_patterns = license,images/*/*.jpg

# (str) Application versioning (method 1)
version = 0.1

# (str) Application versioning (method 2)
# version.regex = __version__ = ['"](.*)['"]
# version.filename = %(source.dir)s/main.py

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = libffi,python3,kivy,sqlalchemy

# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy

# (list) Garden requirements
#garden_requirements =

# (str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png

# (str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png

# (str) Supported orientation (one of landscape, sensorLandscape, portrait or all)
orientation = portrait

# (list) List of service to declare
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY

#
# OSX Specific
#

#
# author = © Copyright Info

# change the major version of python used by the app
osx.python_version = 3

# Kivy version to use
osx.kivy_version = 1.10.1

#
# Android specific
#

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0

# (string) Presplash background color (for new android toolchain)
# Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,
# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,
# olive, purple, silver, teal.
#android.presplash_color = #FFFFFF

# (list) Permissions
#android.permissions = INTERNET

# (int) Target Android API, should be as high as possible.
#android.api = 27

# (int) Minimum API your APK will support.
#android.minapi = 21

# (int) Android SDK version to use
#android.sdk = 20

# (str) Android NDK version to use
#android.ndk = 17c

# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.
#android.ndk_api = 21

# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
#android.ndk_path =

# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path =

# (str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path =

# (bool) If True, then skip trying to update the Android sdk
# This can be useful to avoid excess Internet downloads or save time
# when an update is due and you just want to test/build your package
# android.skip_update = False

# (bool) If True, then automatically accept SDK license
# agreements. This is intended for automation only. If set to False,
# the default, you will be shown the license when first running
# buildozer.
# android.accept_sdk_license = False

# (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.renpy.android.PythonActivity

# (list) Pattern to whitelist for the whole project
#android.whitelist =

# (str) Path to a custom whitelist file
#android.whitelist_src =

# (str) Path to a custom blacklist file
#android.blacklist_src =

# (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar

# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
#android.add_src =

# (list) Android AAR archives to add (currently works only with sdl2_gradle
# bootstrap)
#android.add_aars =

# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
#android.gradle_dependencies =

# (list) Java classes to add as activities to the manifest.
#android.add_activites = com.example.ExampleActivity

# (str) python-for-android branch to use, defaults to master
p4a.branch = master

# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME

# (str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png

# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =

# (str) launchMode to set for the main activity
#android.manifest.launch_mode = standard

# (list) Android additional libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
#android.add_libs_x86 = libs/android-x86/*.so
#android.add_libs_mips = libs/android-mips/*.so

# (bool) Indicate whether the screen should stay on
# Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False

# (list) Android application meta-data to set (key=value format)
#android.meta_data =

# (list) Android library project to add (will be added in the
# project.properties automatically.)
#android.library_references =

# (str) Android logcat filters to use
#android.logcat_filters = *:S python:D

# (bool) Copy library instead of making a libpymodules.so
#android.copy_libs = 1

# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64
android.arch = armeabi-v7a

#
# Python for android (p4a) specific
#

# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =

# (str) The directory in which python-for-android should look for your own build recipes (if any)
#p4a.local_recipes =

# (str) Filename to the hook for p4a
#p4a.hook =

# (str) Bootstrap to use for android builds
# p4a.bootstrap = sdl2

# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)
#p4a.port =


#
# iOS specific
#

# (str) Path to a custom kivy-ios folder
#ios.kivy_ios_dir = ../kivy-ios
# Alternately, specify the URL and branch of a git checkout:
ios.kivy_ios_url = https://github.com/kivy/kivy-ios
ios.kivy_ios_branch = master

# Another platform dependency: ios-deploy
# Uncomment to use a custom checkout
#ios.ios_deploy_dir = ../ios_deploy
# Or specify URL and branch
ios.ios_deploy_url = https://github.com/phonegap/ios-deploy
ios.ios_deploy_branch = 1.7.0

# (str) Name of the certificate to use for signing the debug version
# Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"

# (str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s


[buildozer]

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2

# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1

# (str) Path to build artifact storage, absolute or relative to spec file
# build_dir = ./.buildozer

# (str) Path to build output (i.e. .apk, .ipa) storage
# bin_dir = ./bin

#    -----------------------------------------------------------------------------
#    List as sections
#
#    You can define all the "list" as [section:key].
#    Each line will be considered as a option to the list.
#    Let's take [app] / source.exclude_patterns.
#    Instead of doing:
#
#[app]
#source.exclude_patterns = license,data/audio/*.wav,data/images/original/*
#
#    This can be translated into:
#
#[app:source.exclude_patterns]
#license
#data/audio/*.wav
#data/images/original/*
#


#    -----------------------------------------------------------------------------
#    Profiles
#
#    You can extend section / key with a profile
#    For example, you want to deploy a demo version of your application without
#    HD content. You could first change the title to add "(demo)" in the name
#    and extend the excluded directories to remove the HD content.
#
#[app@demo]
#title = My Application (demo)
#
#[app:source.exclude_patterns@demo]
#images/hd/*
#
#    Then, invoke the command line with the "demo" profile:
#
#buildozer --profile demo android debug

Logs

[INFO]:    -> running python setup.py install -O2 --root=/home/myasul/Documents/personal_projects/ekt_dictionary/.buildozer/android/platform/build/bu...(and 50 more)
[INFO]:    <- directory context /home/myasul/Documents/personal_projects/ekt_dictionary/.buildozer/android/platform/python-for-android                                          
[INFO]:    Building sqlalchemy for armeabi-v7a
[INFO]:    sqlalchemy apparently isn't already in site-packages
[INFO]:    Building compiled components in sqlalchemy
[INFO]:    -> directory context /home/myasul/Documents/personal_projects/ekt_dictionary/.buildozer/android/platform/build/build/other_builds/sqlalchemy-python3/armeabi-v7a__ndk_target_21/sqlalchemy
[INFO]:    -> running python setup.py build_ext -v
Traceback (most recent call last):                                                                                                                                              
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/myasul/Documents/personal_projects/ekt_dictionary/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1081, in <module>
    main()
  File "/home/myasul/Documents/personal_projects/ekt_dictionary/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1075, in main
    ToolchainCL()
  File "/home/myasul/Documents/personal_projects/ekt_dictionary/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 577, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/myasul/Documents/personal_projects/ekt_dictionary/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 151, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/myasul/Documents/personal_projects/ekt_dictionary/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 200, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "/home/myasul/Documents/personal_projects/ekt_dictionary/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 562, in build_recipes
    recipe.build_arch(arch)
  File "/home/myasul/Documents/personal_projects/ekt_dictionary/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 899, in build_arch
    self.build_compiled_components(arch)
  File "/home/myasul/Documents/personal_projects/ekt_dictionary/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 912, in build_compiled_components
    build_dir = glob.glob('build/lib.*')[0]
IndexError: list index out of range
@AndreMiras
Copy link
Member

Thanks for the bug report. This is more like a p4a bug and I confirm I could reproduce it on the Docker container.
I ran the container via:

docker run -it --rm kivy/python-for-android

And below is the recipe build log and error trace:

user@5e765202a995:~$ . venv/bin/activate
(venv) user@5e765202a995:~$ cd testapps/
(venv) user@5e765202a995:~/testapps$ python setup_testapp_python3_sqlite_openssl.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --requirements python3,kivy,sqlalchemy
running apk
WARNING: You did not supply an Android package identifier, trying org.test.testapp_python3_sqlite_openssl_googlendk instead.
         This may fail if this is not a valid identifier
Including testapp_sqlite_openssl/main.py
Including testapp_sqlite_openssl/colours.png
[WARNING]: --ndk-version is deprecated and no longer necessary, the value you passed is ignored
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Getting Android API version from user argument: 27
[INFO]:    Available Android APIs are (19, 27)
[INFO]:    Requested API target 27 is available, continuing.
[INFO]:    Getting NDK dir from from user argument
[INFO]:    Found NDK revision 17.2.4988734
[INFO]:    Getting NDK API version (i.e. minimum supported API) from user argument
[INFO]:    Found virtualenv at /usr/bin/virtualenv
[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.
[INFO]:    Found a single valid recipe set: ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'setuptools', 'six', 'pyjnius', 'sqlalchemy', 'kivy']
[INFO]:    Trying to find a bootstrap that matches the given recipes.
[INFO]:    Found 1 acceptable bootstraps: ['sdl2']
[INFO]:    Using the first of these: sdl2
[INFO]:    Found a single valid recipe set: ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'setuptools', 'six', 'pyjnius', 'sqlalchemy', 'android', 'kivy']
[INFO]:    The selected bootstrap is sdl2
[INFO]:    # Creating dist with sdl2 bootstrap
[INFO]:    Dist will have name bdisttest_python3_sqlite_openssl_googlendk and requirements (python3, kivy, sqlalchemy)
[INFO]:    Dist contains the following requirements as recipes: ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'setuptools', 'six', 'pyjnius', 'sqlalchemy', 'android', 'kivy']                                                                                                                                                                                                                                                                                           
[INFO]:    Dist will also contain modules () installed from pip
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Recipe build order is ['hostpython3', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sqlite3', 'python3', 'sdl2', 'setuptools', 'six', 'pyjnius', 'sqlalchemy', 'android', 'kivy']
[INFO]:    # Downloading recipes 
[INFO]:    Downloading hostpython3
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/hostpython3
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/hostpython3
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[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
[INFO]:    -> running touch .mark-Python-3.7.1.tgz
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading libffi
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/libffi
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/libffi
[INFO]:    -> running basename https://github.com/libffi/libffi/archive/v3.2.1.tar.gz
[INFO]:    -> running rm -f .mark-v3.2.1.tar.gz
[INFO]:    Downloading libffi from https://github.com/libffi/libffi/archive/v3.2.1.tar.gz
[INFO]:    -> running touch .mark-v3.2.1.tar.gz
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading openssl
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/openssl
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/openssl
[INFO]:    -> running basename https://www.openssl.org/source/openssl-1.1.1.tar.gz
[INFO]:    -> running rm -f .mark-openssl-1.1.1.tar.gz
[INFO]:    Downloading openssl from https://www.openssl.org/source/openssl-1.1.1.tar.gz
[INFO]:    -> running touch .mark-openssl-1.1.1.tar.gz
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading sdl2_image
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/sdl2_image
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/sdl2_image
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.tar.gz
[INFO]:    -> running rm -f .mark-SDL2_image-2.0.4.tar.gz
[INFO]:    Downloading sdl2_image from https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.tar.gz
[INFO]:    -> running touch .mark-SDL2_image-2.0.4.tar.gz
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading sdl2_mixer
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/sdl2_mixer
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/sdl2_mixer
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
[INFO]:    -> running rm -f .mark-SDL2_mixer-2.0.1.tar.gz
[INFO]:    Downloading sdl2_mixer from https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
[INFO]:    -> running touch .mark-SDL2_mixer-2.0.1.tar.gz
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading sdl2_ttf
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/sdl2_ttf
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/sdl2_ttf
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]:    -> running rm -f .mark-SDL2_ttf-2.0.14.tar.gz
[INFO]:    Downloading sdl2_ttf from https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]:    -> running touch .mark-SDL2_ttf-2.0.14.tar.gz
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading sqlite3
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/sqlite3
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/sqlite3
[INFO]:    -> running basename https://www.sqlite.org/2016/sqlite-amalgamation-3150100.zip
[INFO]:    -> running rm -f .mark-sqlite-amalgamation-3150100.zip
[INFO]:    Downloading sqlite3 from https://www.sqlite.org/2016/sqlite-amalgamation-3150100.zip
[INFO]:    -> running touch .mark-sqlite-amalgamation-3150100.zip
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading python3
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/python3
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/python3
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[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
[INFO]:    -> running touch .mark-Python-3.7.1.tgz
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading sdl2
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/sdl2
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/sdl2
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
[INFO]:    -> running rm -f .mark-SDL2-2.0.9.tar.gz
[INFO]:    Downloading sdl2 from https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
[INFO]:    -> running touch .mark-SDL2-2.0.9.tar.gz
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading setuptools
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/setuptools
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/setuptools
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/setuptools/setuptools-40.0.0.zip
[INFO]:    -> running rm -f .mark-setuptools-40.0.0.zip
[INFO]:    Downloading setuptools from https://pypi.python.org/packages/source/s/setuptools/setuptools-40.0.0.zip
[INFO]:    -> running touch .mark-setuptools-40.0.0.zip
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading six
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/six
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/six
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
[INFO]:    -> running rm -f .mark-six-1.9.0.tar.gz
[INFO]:    Downloading six from https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
[INFO]:    -> running touch .mark-six-1.9.0.tar.gz
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading pyjnius
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/pyjnius
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/pyjnius
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/6553ad4.zip
[INFO]:    -> running rm -f .mark-6553ad4.zip
[INFO]:    Downloading pyjnius from https://github.com/kivy/pyjnius/archive/6553ad4.zip
[INFO]:    -> running touch .mark-6553ad4.zip
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading sqlalchemy
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/sqlalchemy
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/sqlalchemy
[INFO]:    -> running basename https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-1.0.9.tar.gz
[INFO]:    -> running rm -f .mark-SQLAlchemy-1.0.9.tar.gz
[INFO]:    Downloading sqlalchemy from https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-1.0.9.tar.gz
[INFO]:    -> running touch .mark-SQLAlchemy-1.0.9.tar.gz
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Downloading android
[INFO]:    Skipping android download as no URL is set
[INFO]:    Downloading kivy
[INFO]:    -> running mkdir -p /home/user/.local/share/python-for-android/packages/kivy
[INFO]:    -> directory context /home/user/.local/share/python-for-android/packages/kivy
[INFO]:    -> running basename https://github.com/kivy/kivy/archive/c4d6894.zip
[INFO]:    -> running rm -f .mark-c4d6894.zip
[INFO]:    Downloading kivy from https://github.com/kivy/kivy/archive/c4d6894.zip
[INFO]:    -> running touch .mark-c4d6894.zip
[INFO]:    <- directory context /home/user/testapps
[INFO]:    # Building all recipes for arch armeabi-v7a
[INFO]:    # Unpacking recipes
[INFO]:    Unpacking hostpython3 for armeabi-v7a
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/hostpython3/desktop
[INFO]:    -> running mv Python-3.7.1 /home/user/.local/share/python-for-android/build/other_builds/hostpython3/...(and 19 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking libffi for armeabi-v7a
[INFO]:    -> running basename https://github.com/libffi/libffi/archive/v3.2.1.tar.gz
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__ndk_target_21
[INFO]:    -> running mv libffi-3.2.1 /home/user/.local/share/python-for-android/build/other_builds/libffi/armea...(and 28 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking openssl for armeabi-v7a
[INFO]:    -> running basename https://www.openssl.org/source/openssl-1.1.1.tar.gz
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/openssl/armeabi-v7a__ndk_target_21
[INFO]:    -> running mv openssl-1.1.1 /home/user/.local/share/python-for-android/build/other_builds/openssl/arm...(and 34 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking sdl2_image for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.4.tar.gz
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3/jni
[INFO]:    -> running mv SDL2_image-2.0.4 /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2...(and 23 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking sdl2_mixer for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.tar.gz
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3/jni
[INFO]:    -> running mv SDL2_mixer-2.0.1 /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2...(and 23 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking sdl2_ttf for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3/jni
[INFO]:    -> running mv SDL2_ttf-2.0.14 /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-...(and 20 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking sqlite3 for armeabi-v7a
[INFO]:    -> running basename https://www.sqlite.org/2016/sqlite-amalgamation-3150100.zip
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21
[INFO]:    -> running mv sqlite-amalgamation-3150100 /home/user/.local/share/python-for-android/build/other_buil...(and 45 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking python3 for armeabi-v7a
[INFO]:    -> running basename https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21
[INFO]:    -> running mv Python-3.7.1 /home/user/.local/share/python-for-android/build/other_builds/python3-libf...(and 53 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking sdl2 for armeabi-v7a
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3/jni
[INFO]:    -> running mv SDL2-2.0.9 /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3/jni/SDL
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking setuptools for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/setuptools/setuptools-40.0.0.zip
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/setuptools-python3/armeabi-v7a__ndk_target_21
[INFO]:    -> running mv setuptools-40.0.0 /home/user/.local/share/python-for-android/build/other_builds/setupto...(and 49 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking six for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/six-python3/armeabi-v7a__ndk_target_21
[INFO]:    -> running mv six-1.9.0 /home/user/.local/share/python-for-android/build/other_builds/six-python3/arm...(and 27 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking pyjnius for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/6553ad4.zip
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21
[INFO]:    -> running mv pyjnius-6553ad4409782fd1c37247c64736f4aa698a00b2 /home/user/.local/share/python-for-and...(and 79 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Unpacking sqlalchemy for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-1.0.9.tar.gz
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/sqlalchemy-python3/armeabi-v7a__ndk_target_21
[INFO]:    -> running mv SQLAlchemy-1.0.9 /home/user/.local/share/python-for-android/build/other_builds/sqlalche...(and 48 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    -> running rm -rf /home/user/.local/share/python-for-android/build/other_builds/android-python3-sdl2/...(and 34 more)
[INFO]:    -> running cp -a /home/user/pythonforandroid/recipes/android/src /home/user/.local/share/python-for-a...(and 81 more)
[INFO]:    Unpacking kivy for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/kivy/archive/c4d6894.zip
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/kivy-python3-sdl2/armeabi-v7a__ndk_target_21
[INFO]:    -> running mv kivy-c4d68949b42e97de270528bdc2a39ec9393bd7f4 /home/user/.local/share/python-for-androi...(and 70 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython3 for armeabi-v7a
[INFO]:    hostpython3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding libffi for armeabi-v7a
[INFO]:    libffi has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for libffi[armeabi-v7a]
[INFO]:    Applying patch remove-version-info.patch
[INFO]:    -> running patch -t -d /home/user/.local/share/python-for-android/build/other_builds/libffi/armeabi-v...(and 100 more)
[INFO]:    Applying patch fix-includedir.patch
[INFO]:    -> running patch -t -d /home/user/.local/share/python-for-android/build/other_builds/libffi/armeabi-v...(and 95 more)
[INFO]:    -> running touch /home/user/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__nd...(and 27 more)
[INFO]:    Prebuilding openssl for armeabi-v7a
[INFO]:    openssl 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/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3...(and 95 more)
[INFO]:    Applying patch extra_cflags.patch
[INFO]:    -> running patch -t -d /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3...(and 88 more)
[INFO]:    -> running touch /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3/jni/SDL2_image/.patched
[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/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3...(and 107 more)
[INFO]:    -> running touch /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3/jni/SDL2_mixer/.patched
[INFO]:    Prebuilding sdl2_ttf for armeabi-v7a
[INFO]:    sdl2_ttf has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding sqlite3 for armeabi-v7a
[INFO]:    sqlite3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding python3 for armeabi-v7a
[INFO]:    python3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for python3[armeabi-v7a]
[INFO]:    Applying patch patches/fix-ctypes-util-find-library.patch
[INFO]:    -> running patch -t -d /home/user/.local/share/python-for-android/build/other_builds/python3-libffi-o...(and 143 more)
[INFO]:    -> running touch /home/user/.local/share/python-for-android/build/other_builds/python3-libffi-openssl...(and 52 more)
[INFO]:    Prebuilding sdl2 for armeabi-v7a
[INFO]:    sdl2 has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding setuptools for armeabi-v7a
[INFO]:    setuptools has no prebuild_armeabi_v7a, skipping
[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/user/.local/share/python-for-android/build/other_builds/pyjnius-python3-...(and 115 more)
[INFO]:    -> running touch /home/user/.local/share/python-for-android/build/other_builds/pyjnius-python3-sdl2/a...(and 42 more)
[INFO]:    Prebuilding sqlalchemy for armeabi-v7a
[INFO]:    sqlalchemy has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for sqlalchemy[armeabi-v7a]
[INFO]:    Applying patch zipsafe.patch
[INFO]:    -> running patch -t -d /home/user/.local/share/python-for-android/build/other_builds/sqlalchemy-pytho...(and 108 more)
[INFO]:    -> running touch /home/user/.local/share/python-for-android/build/other_builds/sqlalchemy-python3/arm...(and 43 more)
[INFO]:    Prebuilding android for armeabi-v7a
[INFO]:    android has no prebuild_armeabi_v7a, skipping
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/android-python3-sdl2/armeabi-v7a__ndk_target_21/android
[INFO]:    <- directory context /home/user/testapps
[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/user/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build
[INFO]:    -> running configure
[INFO]:    <- directory context /home/user/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3
[INFO]:    -> running cp Modules/Setup.dist /home/user/.local/share/python-for-android/build/other_builds/hostpy...(and 52 more)
[INFO]:    -> running make -j 4 -C /home/user/.local/share/python-for-android/build/other_builds/hostpython3/des...(and 29 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Building libffi for armeabi-v7a
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi
[INFO]:    -> running autogen.sh
[INFO]:    -> running autoreconf -vif
[INFO]:    -> running configure --host=arm-linux-androideabi --prefix=/home/user/.local/share/python-for-android...(and 95 more)
[INFO]:    -> running make -j 4 libffi.la
[INFO]:    -> running cp /home/user/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__ndk_t...(and 152 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Building openssl for armeabi-v7a
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/openssl/armeabi-v7a__ndk_target_21/openssl1.1
[INFO]:    -> running perl Configure shared no-dso no-asm android-arm -D__ANDROID_API__=21
[INFO]:    Applying patch disable-sover.patch
[INFO]:    -> running patch -t -d /home/user/.local/share/python-for-android/build/other_builds/openssl/armeabi-...(and 100 more)
[INFO]:    -> running make build_libs
[INFO]:    -> running cp libssl1.1.so libcrypto1.1.so /home/user/.local/share/python-for-android/build/libs_coll...(and 62 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Building sdl2_image for armeabi-v7a
[INFO]:    Building sdl2_mixer for armeabi-v7a
[INFO]:    Building sdl2_ttf for armeabi-v7a
[INFO]:    Building sqlite3 for armeabi-v7a
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3
[INFO]:    -> running ndk-build V=1 APP_PLATFORM=android-21 APP_ABI=armeabi-v7a
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Building python3 for armeabi-v7a
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/android-build
[WARNING]: Doing some hacky stuff to link properly
[INFO]:    -> running cp /opt/android/android-ndk-r17c/platforms/android-21/arch-arm/usr/lib/crtbegin_so.o ./
[INFO]:    -> running cp /opt/android/android-ndk-r17c/platforms/android-21/arch-arm/usr/lib/crtend_so.o ./
[WARNING]: lld not found, linking without it. Consider installing lld if linker errors occur.
[INFO]:    Activating flags for sqlite3
[INFO]:    Activating flags for libffi
[INFO]:    Activating flags for openssl
[INFO]:    -> running configure --host=arm-linux-androideabi --build=x86_64-pc-linux-gnu --enable-shared --disab...(and 274 more)
[INFO]:    -> running make all -j 4 INSTSONAME=libpython3.7m.so
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Building sdl2 for armeabi-v7a
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/bootstrap_builds/sdl2-python3/jni
[INFO]:    -> running ndk-build V=1
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Building setuptools for armeabi-v7a
[INFO]:    setuptools apparently isn't already in site-packages
[INFO]:    Installing setuptools into site-packages
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/setuptools-python3/armeabi-v7a__ndk_target_21/setuptools
[INFO]:    -> running python setup.py install -O2 --root=/home/user/.local/share/python-for-android/build/python...(and 68 more)
[INFO]:    -> running python setup.py install -O2 --root=/home/user/.local/share/python-for-android/build/other_...(and 83 more)
[INFO]:    <- directory context /home/user/testapps
[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/user/.local/share/python-for-android/build/other_builds/six-python3/armeabi-v7a__ndk_target_21/six
[INFO]:    -> running python setup.py install -O2 --root=/home/user/.local/share/python-for-android/build/python...(and 68 more)
[INFO]:    <- directory context /home/user/testapps
[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/user/.local/share/python-for-android/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
           working: error: command '/usr/bin/ccache' failed with exit status 1                                                             Exception in thread background thread for pid 994:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/venv/lib/python3.6/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/user/venv/lib/python3.6/site-packages/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/home/user/venv/lib/python3.6/site-packages/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/user/venv/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /home/user/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python setup.py build_ext -v

  STDOUT:
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
/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -fomit-frame-pointer -D__ANDROID_API__=21 -mandroid -isystem /opt/android/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -I/opt/android/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -isysroot /opt/android/android-ndk-r17c/sysroot -I/home/user/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/include/python3.7 -DNDEBUG -g -fwrapv -O3 -Wall -DANDROID -fomit-frame-pointer -D__ANDROID_API__=21 -mandroid -isystem /opt/android/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -I/opt/android/android-ndk-r17c/sysroot/usr/include/arm-linux-androideabi -isysroot /opt/android/android-ndk-r17c/sysroot -I/home/user/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/include/python3.7 -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -I/home/user/.local/share/python-for-android/build/other_builds/python3-l
ibffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/Include -fPIC -I/home/user/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/user/.local/share/python-for-android/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 '/usr/bin/ccache' failed with exit status 1


  STDERR:



[INFO]:    pyjnius first build failed (as expected)
[INFO]:    Running cython where appropriate
[INFO]:    Cythonize jnius/jnius.pyx
[INFO]:    -> running cython ./jnius/jnius.pyx
[INFO]:    -> running python setup.py build_ext -v
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]:    Stripping object files
[INFO]:    -> running find . -iname *.so -exec /usr/bin/echo {} ;
[INFO]:    -> running find . -iname *.so -exec arm-linux-androideabi-strip --strip-unneeded {} ;
[INFO]:    <- directory context /home/user/.local/share/python-for-android/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Installing pyjnius into site-packages
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21/pyjnius
[INFO]:    -> running python setup.py install -O2 --root=/home/user/.local/share/python-for-android/build/python...(and 68 more)
[INFO]:    <- directory context /home/user/testapps
[INFO]:    Building sqlalchemy for armeabi-v7a
[INFO]:    sqlalchemy apparently isn't already in site-packages
[INFO]:    Building compiled components in sqlalchemy
[INFO]:    -> directory context /home/user/.local/share/python-for-android/build/other_builds/sqlalchemy-python3/armeabi-v7a__ndk_target_21/sqlalchemy
[INFO]:    -> running python setup.py build_ext -v
Traceback (most recent call last):
  File "setup_testapp_python3_sqlite_openssl.py", line 22, in <module>
    package_data={'testapp_sqlite_openssl': ['*.py', '*.png']}
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/user/pythonforandroid/bdistapk.py", line 80, in run
    main()
  File "/home/user/pythonforandroid/toolchain.py", line 1075, in main
    ToolchainCL()
  File "/home/user/pythonforandroid/toolchain.py", line 577, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/home/user/pythonforandroid/toolchain.py", line 151, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/user/pythonforandroid/toolchain.py", line 200, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "/home/user/pythonforandroid/build.py", line 562, in build_recipes
    recipe.build_arch(arch)
  File "/home/user/pythonforandroid/recipe.py", line 899, in build_arch
    self.build_compiled_components(arch)
  File "/home/user/pythonforandroid/recipe.py", line 912, in build_compiled_components
    build_dir = glob.glob('build/lib.*')[0]
IndexError: list index out of range
(venv) user@5e765202a995:~/testapps$

@AndreMiras AndreMiras transferred this issue from kivy/buildozer Mar 28, 2019
@AndreMiras AndreMiras added the bug label Mar 28, 2019
@AndreMiras
Copy link
Member

@myasul so this is a confirmed p4a bug, most likely on the pythonforandroid/recipes/sqlalchemy/init.py recipe. Would you like to give it a try fixing it? I can assist.

@strubbi77
Copy link
Contributor

I would be very interested that this bug will be fixed soon.
Any base direction what I should fix?

@AndreMiras
Copy link
Member

AndreMiras commented Mar 29, 2019

Great that you're willing to take a look 😄
So I imagine the idea is that this line build_dir = glob.glob('build/lib.*')[0] failed because no lib.* were found after sqlalchemy got built.
So I would look in your build folder ~/.local/share/python-for-android/build/other_builds/sqlalchemy-python3/armeabi-v7a__ndk_target_21/sqlalchemy see what was actually built. If it was built properly, but just the name is not matching then you can try to override the build_compiled_components() method to fix that part.
Edit:
Also the pypi version looks pretty outdated, last version is SQLAlchemy==1.3.1 so I would bump that as well. Usually the more up to date a lib is the better it cross compile

@strubbi77
Copy link
Contributor

Strange, I get another error using latest master:
Last time 1-2 months ago I had this glob.glob error as well.

[INFO]: -> directory context /home/pille/.local/share/python-for-android/build/other_builds/sqlalchemy-python3/armeabi-v7a__ndk_target_21/sqlalchemy
[INFO]: -> running python setup.py install -O2 --root=/home/pille/.local/share/python-for-andr...(and 53 more)
working: ModuleNotFoundError: No module named 'setuptools' Exception in thread background thread for pid 30446:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.7/dist-packages/sh.py", line 2170, in background_thread
handle_exit_code(exit_code)
File "/usr/local/lib/python3.7/dist-packages/sh.py", line 1929, in fn
return self.command.handle_command_exit_code(exit_code)
File "/usr/local/lib/python3.7/dist-packages/sh.py", line 672, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:

RAN: /home/pille/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python setup.py install -O2 --root=/home/pille/.local/share/python-for-android/build/python-installs/MVO_Bed_App --install-lib=.

STDOUT:
Traceback (most recent call last):
File "setup.py", line 10, in
from setuptools import Distribution as _Distribution
ModuleNotFoundError: No module named 'setuptools'

STDERR:

Traceback (most recent call last):
File "/usr/local/bin/p4a", line 11, in
load_entry_point('python-for-android==0.7.1', 'console_scripts', 'p4a')()
File "/usr/local/lib/python3.7/dist-packages/python_for_android-0.7.1-py3.7.egg/pythonforandroid/toolchain.py", line 1075, in main
ToolchainCL()
File "/usr/local/lib/python3.7/dist-packages/python_for_android-0.7.1-py3.7.egg/pythonforandroid/toolchain.py", line 577, in init
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/usr/local/lib/python3.7/dist-packages/python_for_android-0.7.1-py3.7.egg/pythonforandroid/toolchain.py", line 151, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/usr/local/lib/python3.7/dist-packages/python_for_android-0.7.1-py3.7.egg/pythonforandroid/toolchain.py", line 200, in build_dist_from_args
build_recipes(build_order, python_modules, ctx)
File "/usr/local/lib/python3.7/dist-packages/python_for_android-0.7.1-py3.7.egg/pythonforandroid/build.py", line 562, in build_recipes
recipe.build_arch(arch)
File "/usr/local/lib/python3.7/dist-packages/python_for_android-0.7.1-py3.7.egg/pythonforandroid/recipe.py", line 834, in build_arch
self.install_python_package(arch)
File "/usr/local/lib/python3.7/dist-packages/python_for_android-0.7.1-py3.7.egg/pythonforandroid/recipe.py", line 855, in install_python_package
_env=hpenv, *self.setup_extra_args)
File "/usr/local/lib/python3.7/dist-packages/python_for_android-0.7.1-py3.7.egg/pythonforandroid/logger.py", line 178, in shprint
for line in output:
File "/usr/local/lib/python3.7/dist-packages/sh.py", line 720, in next
self.wait()
File "/usr/local/lib/python3.7/dist-packages/sh.py", line 651, in wait
self.handle_command_exit_code(exit_code)
File "/usr/local/lib/python3.7/dist-packages/sh.py", line 672, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:

RAN: /home/pille/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build/python setup.py install -O2 --root=/home/pille/.local/share/python-for-android/build/python-installs/MVO_Bed_App --install-lib=.

STDOUT:
Traceback (most recent call last):
File "setup.py", line 10, in
from setuptools import Distribution as _Distribution
ModuleNotFoundError: No module named 'setuptools'

STDERR:

@strubbi77
Copy link
Contributor

Ran the same in docker.

File "/home/user/pythonforandroid/recipe.py", line 912, in build_compiled_components
build_dir = glob.glob('build/lib.*')[0]
IndexError: list index out of range

But no lib.* files.
(venv) user@0924040531b1:~/.local/share/python-for-android/build/other_builds/sqlalchemy-python3/armeabi-v7a__ndk_target_21/sqlalchemy$ find build/

build/
build/temp.linux-x86_64-3.7
build/temp.linux-x86_64-3.7/lib
build/temp.linux-x86_64-3.7/lib/sqlalchemy
build/temp.linux-x86_64-3.7/lib/sqlalchemy/cextension

@myasul
Copy link
Author

myasul commented Mar 31, 2019

@AndreMiras thank you for the quick response. I'll have a look at it tomorrow.

@ghost ghost added the recipe label Apr 4, 2019
@strubbi77
Copy link
Contributor

Should be fixed with #1794 as well.

@AndreMiras
Copy link
Member

True that 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@AndreMiras @strubbi77 @myasul and others