kivy / python-for-android

Turn your Python application into an Android APK
https://python-for-android.readthedocs.io
MIT License
8.38k stars 1.87k forks source link

Failed to make a webview application using flask #2271

Open Inlife-raphael opened 4 years ago

Inlife-raphael commented 4 years ago

2270 # Checklist

Versions

Description

I try to make a simple webview application using flask with the code:

from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello():
    return "Hello world!"

if __name__ == "__main__":
    app.run(debug=False)

Command:

p4a apk --private $HOME/WebApp --package=org.example.myapp --name "My WebView Application" --version 0.1 --bootstrap=webview --requirements=flask --port=5000 --sdk-dir=/home/inlife/Android/Sdk --android-api 30 --APP_PLATFORM android-30

Logs

[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Getting Android API version from user argument: 30
[INFO]:    Available Android APIs are (30)
[INFO]:    Requested API target 30 is available, continuing.
[INFO]:    Found possible NDK dirs in buildozer dir: android-ndk-r19c
[INFO]:    Will attempt to use NDK at /home/inlife/.buildozer/android/platform/android-ndk-r19c
[WARNING]: This NDK lookup is intended for debug only, if you use python-for-android much you should probably maintain your own NDK download.
[INFO]:    Found NDK version 19c
[WARNING]: NDK API target was not set manually, using the default of 21 = min(android-api=30, default ndk-api=21)
[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', 'sqlite3', 'python3', 'genericndkbuild', 'setuptools', 'flask', 'six', 'pyjnius', 'android']
[INFO]:    The selected bootstrap is webview
[INFO]:    # Creating dist with webview bootstrap
[INFO]:    Dist will have name unnamed_dist_1 and requirements (flask)
[INFO]:    Dist contains the following requirements as recipes: ['hostpython3', 'libffi', 'openssl', 'sqlite3', 'python3', 'genericndkbuild', 'setuptools', 'flask', 'six', 'pyjnius', 'android']
[INFO]:    Dist will also contain modules (itsdangerous, click, werkzeug, jinja2, markupsafe) installed from pip
[INFO]:    Dist will be build in mode debug
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/bootstrap_builds/webview
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Recipe build order is ['hostpython3', 'libffi', 'openssl', 'sqlite3', 'python3', 'genericndkbuild', 'setuptools', 'flask', 'six', 'pyjnius', 'android']
[INFO]:    The requirements (click, itsdangerous, jinja2, markupsafe, werkzeug) were not found as recipes, they will be installed with pip.
[INFO]:    # Downloading recipes 
[INFO]:    Downloading hostpython3
[INFO]:    -> running mkdir -p /home/inlife/.local/share/python-for-android/packages/hostpython3
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/packages/hostpython3
[INFO]:    -> running basename https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
[INFO]:    -> running rm -f .mark-Python-3.8.1.tgz                                                                                                   
[INFO]:    Downloading hostpython3 from https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
[INFO]:    -> running touch .mark-Python-3.8.1.tgz
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Downloading libffi
[INFO]:    -> running mkdir -p /home/inlife/.local/share/python-for-android/packages/libffi
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/packages/libffi
[INFO]:    -> running basename https://github.com/libffi/libffi/archive/8fa8837.tar.gz
[INFO]:    -> running rm -f .mark-8fa8837.tar.gz                                                                                                     
[INFO]:    Downloading libffi from https://github.com/libffi/libffi/archive/8fa8837.tar.gz
[INFO]:    -> running touch .mark-8fa8837.tar.gz
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Downloading openssl
[INFO]:    -> running mkdir -p /home/inlife/.local/share/python-for-android/packages/openssl
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/packages/openssl
[INFO]:    -> running basename https://www.openssl.org/source/openssl-1.1.1f.tar.gz
[INFO]:    -> running rm -f .mark-openssl-1.1.1f.tar.gz                                                                                              
[INFO]:    Downloading openssl from https://www.openssl.org/source/openssl-1.1.1f.tar.gz
[INFO]:    -> running touch .mark-openssl-1.1.1f.tar.gz
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Downloading sqlite3
[INFO]:    -> running mkdir -p /home/inlife/.local/share/python-for-android/packages/sqlite3
[INFO]:    -> directory context /home/inlife/.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/inlife/Desktop/WebApp
[INFO]:    Downloading python3
[INFO]:    -> running mkdir -p /home/inlife/.local/share/python-for-android/packages/python3
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/packages/python3
[INFO]:    -> running basename https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
[INFO]:    -> running rm -f .mark-Python-3.8.1.tgz                                                                                                   
[INFO]:    Downloading python3 from https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
[INFO]:    -> running touch .mark-Python-3.8.1.tgz
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Downloading genericndkbuild
[INFO]:    Skipping genericndkbuild download as no URL is set
[INFO]:    Downloading setuptools
[INFO]:    -> running mkdir -p /home/inlife/.local/share/python-for-android/packages/setuptools
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/packages/setuptools
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/setuptools/setuptools-40.9.0.zip
[INFO]:    -> running rm -f .mark-setuptools-40.9.0.zip                                                                                              
[INFO]:    Downloading setuptools from https://pypi.python.org/packages/source/s/setuptools/setuptools-40.9.0.zip
[INFO]:    -> running touch .mark-setuptools-40.9.0.zip
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Downloading flask
[INFO]:    -> running mkdir -p /home/inlife/.local/share/python-for-android/packages/flask
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/packages/flask
[INFO]:    -> running basename https://github.com/pallets/flask/archive/0.10.1.zip
[INFO]:    -> running rm -f .mark-0.10.1.zip                                                                                                         
[INFO]:    Downloading flask from https://github.com/pallets/flask/archive/0.10.1.zip
[INFO]:    -> running touch .mark-0.10.1.zip
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Downloading six
[INFO]:    -> running mkdir -p /home/inlife/.local/share/python-for-android/packages/six
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/packages/six
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz
[INFO]:    -> running rm -f .mark-six-1.10.0.tar.gz                                                                                                  
[INFO]:    Downloading six from https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz
[INFO]:    -> running touch .mark-six-1.10.0.tar.gz
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Downloading pyjnius
[INFO]:    -> running mkdir -p /home/inlife/.local/share/python-for-android/packages/pyjnius
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/packages/pyjnius
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/1.2.1.zip
[INFO]:    -> running rm -f .mark-1.2.1.zip                                                                                                          
[INFO]:    Downloading pyjnius from https://github.com/kivy/pyjnius/archive/1.2.1.zip
[INFO]:    -> running touch .mark-1.2.1.zip
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Downloading android
[INFO]:    Skipping android download as no URL is set
[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.8.1/Python-3.8.1.tgz
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/hostpython3/desktop                                  
[INFO]:    -> running mv Python-3.8.1 /home/inlife/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Unpacking libffi for armeabi-v7a
[INFO]:    -> running basename https://github.com/libffi/libffi/archive/8fa8837.tar.gz
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__ndk_target_21                    
[INFO]:    -> running mv libffi-8fa88373a1d433c675b11200ccd58418e91f81e4 /home/inlife/.local/share/python-for-android/buil...(and 55 more)
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Unpacking openssl for armeabi-v7a
[INFO]:    -> running basename https://www.openssl.org/source/openssl-1.1.1f.tar.gz
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/openssl/armeabi-v7a__ndk_target_21                   
[INFO]:    -> running mv openssl-1.1.1f /home/inlife/.local/share/python-for-android/build/other_builds/openssl/armeabi-v7...(and 27 more)
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Unpacking sqlite3 for armeabi-v7a
[INFO]:    -> running basename https://www.sqlite.org/2016/sqlite-amalgamation-3150100.zip
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21                   
[INFO]:    -> running mv sqlite-amalgamation-3150100 /home/inlife/.local/share/python-for-android/build/other_builds/sqlit...(and 37 more)
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Unpacking python3 for armeabi-v7a
[INFO]:    -> running basename https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_target_21                   
[INFO]:    -> running mv Python-3.8.1 /home/inlife/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a_...(and 22 more)
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Unpacking genericndkbuild for armeabi-v7a
[INFO]:    Skipping genericndkbuild unpack as no URL is set
[INFO]:    Unpacking setuptools for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/setuptools/setuptools-40.9.0.zip
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/setuptools/armeabi-v7a__ndk_target_21                
[INFO]:    -> running mv setuptools-40.9.0 /home/inlife/.local/share/python-for-android/build/other_builds/setuptools/arme...(and 33 more)
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Unpacking flask for armeabi-v7a
[INFO]:    -> running basename https://github.com/pallets/flask/archive/0.10.1.zip
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/flask/armeabi-v7a__ndk_target_21                     
[INFO]:    -> running mv flask-0.10.1 /home/inlife/.local/share/python-for-android/build/other_builds/flask/armeabi-v7a__ndk_target_21/flask
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Unpacking six for armeabi-v7a
[INFO]:    -> running basename https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/six/armeabi-v7a__ndk_target_21                       
[INFO]:    -> running mv six-1.10.0 /home/inlife/.local/share/python-for-android/build/other_builds/six/armeabi-v7a__ndk_target_21/six
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Unpacking pyjnius for armeabi-v7a
[INFO]:    -> running basename https://github.com/kivy/pyjnius/archive/1.2.1.zip
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/pyjnius-genericndkbuild/armeabi-v7a__ndk_target_21   
[INFO]:    -> running mv pyjnius-1.2.1 /home/inlife/.local/share/python-for-android/build/other_builds/pyjnius-genericndkb...(and 39 more)
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    -> running rm -rf /home/inlife/.local/share/python-for-android/build/other_builds/android-genericndkbuild/armea...(and 29 more)
[INFO]:    -> running cp -a /home/inlife/.local/lib/python3.8/site-packages/pythonforandroid/recipes/android/src /home/inl...(and 113 more)
[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython3 for armeabi-v7a
[INFO]:    hostpython3 has no prebuild_armeabi_v7a, skipping
[INFO]:    Applying patches for hostpython3[armeabi-v7a]
[INFO]:    Applying patch patches/pyconfig_detection.patch
[INFO]:    -> running patch -t -d /home/inlife/.local/share/python-for-android/build/other_builds/hostpython3/desktop/host...(and 132 more)
[INFO]:    -> running touch /home/inlife/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/.patched                 
[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/inlife/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__ndk_...(and 129 more)
[INFO]:    -> running touch /home/inlife/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__ndk_target...(and 19 more)           
[INFO]:    Prebuilding openssl for armeabi-v7a
[INFO]:    openssl 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/pyconfig_detection.patch
[INFO]:    -> running patch -t -d /home/inlife/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk...(and 139 more)
[INFO]:    Applying patch patches/py3.8.1.patch                                                                                                      
[INFO]:    -> running patch -t -d /home/inlife/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk...(and 128 more)
[INFO]:    Applying patch patches/py3.8.1_fix_cortex_a8.patch                                                                                        
[INFO]:    -> running patch -t -d /home/inlife/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk...(and 142 more)
[INFO]:    -> running touch /home/inlife/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_targe...(and 21 more)           
[INFO]:    Prebuilding genericndkbuild for armeabi-v7a
[INFO]:    genericndkbuild has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding setuptools for armeabi-v7a
[INFO]:    setuptools has no prebuild_armeabi_v7a, skipping
[INFO]:    Prebuilding flask for armeabi-v7a
[INFO]:    flask 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 genericndkbuild_jnienv_getter.patch
[INFO]:    -> running patch -t -d /home/inlife/.local/share/python-for-android/build/other_builds/pyjnius-genericndkbuild/...(and 158 more)
[INFO]:    -> running touch /home/inlife/.local/share/python-for-android/build/other_builds/pyjnius-genericndkbuild/armeab...(and 37 more)           
[INFO]:    Prebuilding android for armeabi-v7a
[INFO]:    android has no prebuild_armeabi_v7a, skipping
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/android-genericndkbuild/armeabi-v7a__ndk_target_21/android
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    # Building recipes
[INFO]:    Building hostpython3 for armeabi-v7a
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build
[INFO]:    -> running configure
[INFO]:    <- directory context /home/inlife/Desktop/WebApp                                                                                          
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3
[INFO]:    -> running make -j 1 -C /home/inlife/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hos...(and 21 more)
[INFO]:    -> running cp /home/inlife/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/n...(and 135 more)          
[INFO]:    <- directory context /home/inlife/Desktop/WebApp
[INFO]:    Building libffi for armeabi-v7a
[INFO]:    -> directory context /home/inlife/.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/inlife/.local/share/python-for-android/build/o...(and 87 more)           
[INFO]:    -> running make -j 1 libffi.la                                                                                                            
[INFO]:    <- directory context /home/inlife/Desktop/WebApp                                                                                          
[INFO]:    -> running cp /home/inlife/.local/share/python-for-android/build/other_builds/libffi/armeabi-v7a__ndk_target_21...(and 118 more)
[INFO]:    Building openssl for armeabi-v7a
[INFO]:    -> directory context /home/inlife/.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/inlife/.local/share/python-for-android/build/other_builds/openssl/armeabi-v7a__ndk...(and 129 more)
[INFO]:    -> running make build_libs                                                                                                                
[INFO]:    <- directory context /home/inlife/Desktop/WebApp                                                                                          
[INFO]:    -> running cp /home/inlife/.local/share/python-for-android/build/other_builds/openssl/armeabi-v7a__ndk_target_2...(and 246 more)
[INFO]:    Building sqlite3 for armeabi-v7a
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/sqlite3/armeabi-v7a__ndk_target_21/sqlite3
[INFO]:    -> running ndk-build V=1 NDK_DEBUG=1 APP_PLATFORM=android-21 APP_ABI=armeabi-v7a
[INFO]:    <- directory context /home/inlife/Desktop/WebApp                                                                                          
[INFO]:    Building python3 for armeabi-v7a
[INFO]:    Activating flags for sqlite3
[INFO]:    Activating flags for libffi
[INFO]:    Activating flags for openssl
[INFO]:    Activating flags for android's zlib
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/android-build
[INFO]:    -> running configure --host=arm-linux-androideabi --build=x86_64-pc-linux-gnu --enable-shared --enable-ipv6 ac_...(and 265 more)
[INFO]:    -> running make all -j 1 INSTSONAME=libpython3.8m.so                                                                                      
[INFO]:    <- directory context /home/inlife/Desktop/WebApp                                                                                          
[INFO]:    Building genericndkbuild for armeabi-v7a
[INFO]:    -> directory context /home/inlife/.local/share/python-for-android/build/bootstrap_builds/webview/jni
[INFO]:    -> running ndk-build V=1
           working: /home/inlife/.buildozer/android/platform/android-ndk-r19c/build/core/setup-app-platform.mk:101: *** Android NDK...(and 23 more)  Exception in thread background thread for pid 33545:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/inlife/.local/lib/python3.8/site-packages/sh.py", line 1662, in wrap
    fn(*args, **kwargs)
  File "/home/inlife/.local/lib/python3.8/site-packages/sh.py", line 2606, in background_thread
    handle_exit_code(exit_code)
  File "/home/inlife/.local/lib/python3.8/site-packages/sh.py", line 2304, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/inlife/.local/lib/python3.8/site-packages/sh.py", line 877, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /home/inlife/.buildozer/android/platform/android-ndk-r19c/ndk-build V=1

  STDOUT:
Android NDK: Found platform level in /home/inlife/.local/share/python-for-android/build/bootstrap_builds/webview/project.properties. Setting APP_PLATFORM to android-30.    
Android NDK: android-30 is above the maximum supported version android-28. Choose a supported API level or set APP_PLATFORM to "latest".    
/home/inlife/.buildozer/android/platform/android-ndk-r19c/build/core/setup-app-platform.mk:101: *** Android NDK: Aborting.    .  Stop.

  STDERR:

Traceback (most recent call last):                                                                                                                   
  File "/home/inlife/.local/bin/p4a", line 8, in <module>
    sys.exit(main())
  File "/home/inlife/.local/lib/python3.8/site-packages/pythonforandroid/entrypoints.py", line 18, in main
    ToolchainCL()
  File "/home/inlife/.local/lib/python3.8/site-packages/pythonforandroid/toolchain.py", line 709, in __init__
    getattr(self, command)(args)
  File "/home/inlife/.local/lib/python3.8/site-packages/pythonforandroid/toolchain.py", line 154, in wrapper_func
    build_dist_from_args(ctx, dist, args)
  File "/home/inlife/.local/lib/python3.8/site-packages/pythonforandroid/toolchain.py", line 213, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx,
  File "/home/inlife/.local/lib/python3.8/site-packages/pythonforandroid/build.py", line 577, in build_recipes
    recipe.build_arch(arch)
  File "/home/inlife/.local/lib/python3.8/site-packages/pythonforandroid/recipes/genericndkbuild/__init__.py", line 28, in build_arch
    shprint(sh.ndk_build, "V=1", _env=env)
  File "/home/inlife/.local/lib/python3.8/site-packages/pythonforandroid/logger.py", line 167, in shprint
    for line in output:
  File "/home/inlife/.local/lib/python3.8/site-packages/sh.py", line 925, in next
    self.wait()
  File "/home/inlife/.local/lib/python3.8/site-packages/sh.py", line 849, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/inlife/.local/lib/python3.8/site-packages/sh.py", line 877, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /home/inlife/.buildozer/android/platform/android-ndk-r19c/ndk-build V=1

  STDOUT:
Android NDK: Found platform level in /home/inlife/.local/share/python-for-android/build/bootstrap_builds/webview/project.properties. Setting APP_PLATFORM to android-30.    
Android NDK: android-30 is above the maximum supported version android-28. Choose a supported API level or set APP_PLATFORM to "latest".    
/home/inlife/.buildozer/android/platform/android-ndk-r19c/build/core/setup-app-platform.mk:101: *** Android NDK: Aborting.    .  Stop.

  STDERR:
kengoon commented 4 years ago

i'm not really sure p4a is used to build a non-kivy app, more over you need to implement the webview inside kivy using "pyjinus" package library

obfusk commented 4 years ago

i'm not really sure p4a is used to build a non-kivy app, more over you need to implement the webview inside kivy using "pyjinus" package library

You can build one just fine by using the webview bootstrap.

obfusk commented 4 years ago

@Inlife-raphael: the error message "android-30 is above the maximum supported version android-28" suggest you need to use a lower version of the api or a newer version of the ndk (instead of 19c).

mnba commented 4 years ago

Using Ubuntu (Mint) I Just build the apk using lower version of ANDROIDSDK and set that envioronment var to it. I had just build the webview bootstrap apk, taking the source from on_device_unit_tests subdirectory tests from here, namely: https://github.com/kivy/python-for-android/tree/develop/testapps/on_device_unit_tests. Regarding the NDKSDK version it can be any, providing it is >=17 and ... I think just any greater number will do, it didn't complain on that when I tried.

The env. variables I set are:

export ANDROIDSDK="$SDK_DIR" export ANDROIDNDK="$SDK_DIR/ndk/21.3.6528147" #now running this

export ANDROIDNDK="$SDK_DIR/ndk-bundle/" #previous NDK versioning scheme/path

export ANDROIDAPI="29" # Target API version of your application export NDKAPI="21" #"19"? # Minimum supported API version of your application export ANDROIDNDKVER="21.3.6528147" #unused now, p4a script complains every time # Version of the NDK you installed

and here my export SDK_DIR=/opt/Android/Sdk, this is the exact one used by my latest Android Studio.

kengoon commented 4 years ago

i'm not really sure p4a is used to build a non-kivy app, more over you need to implement the webview inside kivy using "pyjinus" package library

You can build one just fine by using the webview bootstrap.

Please can you show me how that works with an example and the p4a command to do so. I'll really appreciate in advance(this is new to me)

obfusk commented 4 years ago

i'm not really sure p4a is used to build a non-kivy app, more over you need to implement the webview inside kivy using "pyjinus" package library

You can build one just fine by using the webview bootstrap.

Please can you show me how that works with an example and the p4a command to do so. I'll really appreciate in advance(this is new to me)

I'm using buildozer, so I'm not sure what the p4a command would be exactly. But there is documentation here: https://github.com/kivy/python-for-android/blob/develop/doc/source/quickstart.rst#build-a-webview-application and here: https://github.com/kivy/python-for-android/blob/develop/doc/source/buildoptions.rst#webview

kengoon commented 4 years ago

i'm not really sure p4a is used to build a non-kivy app, more over you need to implement the webview inside kivy using "pyjinus" package library

You can build one just fine by using the webview bootstrap.

Please can you show me how that works with an example and the p4a command to do so. I'll really appreciate in advance(this is new to me)

I'm using buildozer, so I'm not sure what the p4a command would be exactly. But there is documentation here: https://github.com/kivy/python-for-android/blob/develop/doc/source/quickstart.rst#build-a-webview-application and here: https://github.com/kivy/python-for-android/blob/develop/doc/source/buildoptions.rst#webview

Thanks for the documentation. I'm also using buildozer (i was thinking the bootstrap is best implemented in p4a). If you don't mind can you post an example of the buildozer.spec file. So sorry if it sounds disturbing

obfusk commented 4 years ago

i'm not really sure p4a is used to build a non-kivy app, more over you need to implement the webview inside kivy using "pyjinus" package library

You can build one just fine by using the webview bootstrap.

Please can you show me how that works with an example and the p4a command to do so. I'll really appreciate in advance(this is new to me)

I'm using buildozer, so I'm not sure what the p4a command would be exactly. But there is documentation here: https://github.com/kivy/python-for-android/blob/develop/doc/source/quickstart.rst#build-a-webview-application and here: https://github.com/kivy/python-for-android/blob/develop/doc/source/buildoptions.rst#webview

Thanks for the documentation. I'm also using buildozer (i was thinking the bootstrap is best implemented in p4a). If you don't mind can you post an example of the buildozer.spec file. So sorry if it sounds disturbing

[app]
title = MyApp
package.name = myapp
package.domain = com.example
source.dir = .
source.include_exts = py
source.exclude_dirs = bin
source.exclude_patterns = *.png
version = 1.0.0
requirements = python3,flask
icon.filename = %(source.dir)s/icon.png
orientation = portrait
fullscreen = 0
android.api = 27
android.minapi = 21
android.ndk = 19c
#android.ndk_path =
#android.sdk_path =
android.accept_sdk_license = True
android.arch = armeabi-v7a
p4a.branch = develop
p4a.bootstrap = webview
p4a.port = 5000

[buildozer]
log_level = 2
warn_on_root = 1
kengoon commented 4 years ago

i'm not really sure p4a is used to build a non-kivy app, more over you need to implement the webview inside kivy using "pyjinus" package library

You can build one just fine by using the webview bootstrap.

Please can you show me how that works with an example and the p4a command to do so. I'll really appreciate in advance(this is new to me)

I'm using buildozer, so I'm not sure what the p4a command would be exactly. But there is documentation here: https://github.com/kivy/python-for-android/blob/develop/doc/source/quickstart.rst#build-a-webview-application and here: https://github.com/kivy/python-for-android/blob/develop/doc/source/buildoptions.rst#webview

Thanks for the documentation. I'm also using buildozer (i was thinking the bootstrap is best implemented in p4a). If you don't mind can you post an example of the buildozer.spec file. So sorry if it sounds disturbing

[app]
title = MyApp
package.name = myapp
package.domain = com.example
source.dir = .
source.include_exts = py
source.exclude_dirs = bin
source.exclude_patterns = *.png
version = 1.0.0
requirements = python3,flask
icon.filename = %(source.dir)s/icon.png
orientation = portrait
fullscreen = 0
android.api = 27
android.minapi = 21
android.ndk = 19c
#android.ndk_path =
#android.sdk_path =
android.accept_sdk_license = True
android.arch = armeabi-v7a
p4a.branch = develop
p4a.bootstrap = webview
p4a.port = 5000

[buildozer]
log_level = 2
warn_on_root = 1

Thanks man