Search code examples
python-3.xkivybuildozer

Buildozer complete apk packaging but crashed with no error in logcat


I've been trying to get my apk to work. In buildozer, i don't think i see any error and it actually able to complete packaging. Currently it just load the app and after the kivy logo loading screen, it just close down.

here is my buldozer.spec:

[app]

# (str) Title of your application
title =  Rimau

# (str) Package name
package.name = rimau

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

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

# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas,ttf,ini,ico,json

# (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, venv

# (list) List of exclusions using pattern matching
# Do not prefix with './'
#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 = python3==3.10.6,kivy==2.1.0,kivymd==1.1.1,mysql-connector,pillow,requests

and the logcat:

--------- beginning of main
03-15 23:02:34.231  9021  9088 I python  : Initializing Python for Android
03-15 23:02:34.231  9021  9088 I python  : Setting additional env vars from p4a_env_vars.txt
03-15 23:02:34.231  9021  9088 I python  : Changing directory to the one provided by ANDROID_ARGUMENT
03-15 23:02:34.231  9021  9088 I python  : /data/user/0/com.blurryrox.rimau/files/app
03-15 23:02:34.233  9021  9088 I python  : Preparing to initialize python
03-15 23:02:34.234  9021  9088 I python  : _python_bundle dir exists
03-15 23:02:34.234  9021  9088 I python  : calculated paths to be...
03-15 23:02:34.234  9021  9088 I python  : /data/user/0/com.blurryrox.rimau/files/app/_python_bundle/stdlib.zip:/data/user/0/com.blurryrox.rimau/files/app/_python_bundle/modules
03-15 23:02:34.235  9021  9088 I python  : set wchar paths...
03-15 23:02:34.260  9021  9088 I python  : Initialized python
03-15 23:02:34.260  9021  9088 I python  : AND: Init threads
03-15 23:02:34.261  9021  9088 I python  : testing python print redirection
03-15 23:02:34.261  9021  9088 I python  : Android path ['.', '/data/user/0/com.blurryrox.rimau/files/app/_python_bundle/stdlib.zip', '/data/user/0/com.blurryrox.rimau/files/app/_python_bundle/modules', '/data/user/0/com.blurryrox.rimau/files/app/_python_bundle/site-packages']
03-15 23:02:34.261  9021  9088 I python  : os.environ is environ({'PATH': '/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/sbin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin:', 'ANDROID_BOOTLOGO': '1', 'ANDROID_ROOT': '/system', 'ANDROID_ASSETS': '/system/app', 'ANDROID_DATA': '/data', 'ANDROID_STORAGE': '/storage', 'ANDROID_ART_ROOT': '/apex/com.android.art', 'ANDROID_I18N_ROOT': '/apex/com.android.i18n', 'ANDROID_TZDATA_ROOT': '/apex/com.android.tzdata', 'EXTERNAL_STORAGE': '/sdcard', 'ASEC_MOUNTPOINT': '/mnt/asec', 'DOWNLOAD_CACHE': '/data/cache', 'BOOTCLASSPATH': '/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/com.nxp.nfc.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.wifi/javalib/framework-wifi.jar', 'DEX2OATBOOTCLASSPATH': '/apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/system/framework/tcmiface.jar:/system/framework/telephony-ext.jar:/system/framework/com.nxp.nfc.jar:/system/framework/QPerformance.jar:/system/framework/UxPerformance.jar:/system/framework/WfdCommon.jar', 'SYSTEMSERVERCLASSPATH': '/system/framework/com.android.location.provider.jar:/system/framework/services.jar:/system/framework/ethernet-service.jar:/apex/com.android.appsearch/javalib/service-appsearch.jar:/apex/com.android.art/javalib/service-art.jar:/apex/com.android.media/javalib/service-media-s.jar:/apex/com.android.permission/javalib/service-permission.jar', 'STANDALONE_SYSTEMSERVER_JARS': '/apex/com.android.os.statsd/javalib/service-statsd.jar:/apex/com.android.scheduling/javalib/service-scheduling.jar:/apex/com.android.tethering/javalib/service-connectivity.jar', 'ANDROID_SOCKET_zygote': '22', 'ANDROID_SOCKET_usap_pool_primary': '23', 'ANDROID_ENTRYPOINT': 'main.pyc', 'ANDROID_ARGUMENT': '/data/user/0/com.blurryrox.rimau/files/app', 'ANDROID_APP_PATH': '/data/user/0/com.blurryrox.rimau/files/app', 'ANDROID_PRIVATE': '/data/user/0/com.blurryrox.rimau/files', 'ANDROID_UNPACK': '/data/user/0/com.blurryrox.rimau/files/app', 'PYTHONHOME': '/data/user/0/com.blurryrox.rimau/files/app', 'PYTHONPATH': '/data/user/0/com.blurryrox.rimau/files/app:/data/user/0/com.blurryrox.rimau/files/app/lib', 'PYTHONOPTIMIZE': '2', 'P4A_BOOTSTRAP': 'SDL2', 'PYTHON_NAME': 'python', 'P4A_IS_WINDOWED': 'False', 'KIVY_ORIENTATION': 'Portrait', 'P4A_NUMERIC_VERSION': 'None', 'P4A_MINSDK': '21', 'LC_CTYPE': 'C.UTF-8'})
03-15 23:02:34.261  9021  9088 I python  : Android kivy bootstrap done. __name__ is __main__
03-15 23:02:34.261  9021  9088 I python  : AND: Ran string
03-15 23:02:34.261  9021  9088 I python  : Run user program, change dir and execute entrypoint
03-15 23:02:34.349  9021  9088 I python  : [INFO   ] [Logger      ] Record log in /data/user/0/com.blurryrox.rimau/files/app/.kivy/logs/kivy_23-03-15_2.txt
03-15 23:02:34.349  9021  9088 I python  : [INFO   ] [Kivy        ] v2.1.0
03-15 23:02:34.350  9021  9088 I python  : [INFO   ] [Kivy        ] Installed at "/data/user/0/com.blurryrox.rimau/files/app/_python_bundle/site-packages/kivy/__init__.pyc"
03-15 23:02:34.350  9021  9088 I python  : [INFO   ] [Python      ] v3.10.6 (main, Mar 15 2023, 22:03:43) [Clang 14.0.6 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0
03-15 23:02:34.350  9021  9088 I python  : [INFO   ] [Python      ] Interpreter at ""
03-15 23:02:34.350  9021  9088 I python  : [INFO   ] [Logger      ] Purge log fired. Processing...
03-15 23:02:34.350  9021  9088 I python  : [INFO   ] [Logger      ] Purge finished!
03-15 23:02:34.352  9021  9088 I python  : [INFO   ] [KivyMD      ] 1.1.1, git-Unknown, 2023-03-15 (installed at "/data/user/0/com.blurryrox.rimau/files/app/_python_bundle/site-packages/kivymd/__init__.pyc")
03-15 23:02:34.354  9021  9088 I python  : [INFO   ] [Factory     ] 189 symbols loaded
03-15 23:02:34.704  9021  9088 I python  : [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
03-15 23:02:34.715  9021  9088 I python  : [INFO   ] [Text        ] Provider: sdl2
03-15 23:02:34.836  9021  9088 I python  : [INFO   ] [Window      ] Provider: sdl2
03-15 23:02:34.871  9021  9088 I python  : [INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
03-15 23:02:34.874  9021  9088 I python  : [INFO   ] [GL          ] Backend used <sdl2>
03-15 23:02:34.875  9021  9088 I python  : [INFO   ] [GL          ] OpenGL version <b'OpenGL ES 3.2 [email protected] (GIT@a6fd1c3b35, I3c0bc64a9d, 1636540102) (Date:11/10/21)'>
03-15 23:02:34.875  9021  9088 I python  : [INFO   ] [GL          ] OpenGL vendor <b'Qualcomm'>
03-15 23:02:34.875  9021  9088 I python  : [INFO   ] [GL          ] OpenGL renderer <b'Adreno (TM) 660'>
03-15 23:02:34.875  9021  9088 I python  : [INFO   ] [GL          ] OpenGL parsed version: 3, 2
03-15 23:02:34.875  9021  9088 I python  : [INFO   ] [GL          ] Texture max size <16384>
03-15 23:02:34.876  9021  9088 I python  : [INFO   ] [GL          ] Texture max units <16>
03-15 23:02:34.901  9021  9088 I python  : [INFO   ] [Window      ] auto add sdl2 input provider
03-15 23:02:34.902  9021  9088 I python  : [INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
03-15 23:02:35.562  9021  9088 I python  : [WARNING] [Base        ] Unknown <android> provider
03-15 23:02:35.562  9021  9088 I python  : [INFO   ] [Base        ] Start application main loop
03-15 23:02:35.589  9021  9088 I python  : [INFO   ] [GL          ] NPOT texture support is available

Please can someone help? I've been at this for days. I am not sure what i am doing wrong.


Solution

  • So i found my error. It was due to kivyMD and kivy version. The error wasn't listed as they are out of python filter in logcat. So if you can't find the error with adb logcat -s python, just remove the python filter.