kivymd app with pillow android apk crash

138 views
Skip to first unread message

Degenerate Tech

unread,
Sep 17, 2020, 10:45:40 AM9/17/20
to Kivy users support
--------- beginning of main
I/python  (12951): Initializing Python for Android
I/python  (12951): Setting additional env vars from p4a_env_vars.txt
I/python  (12951): Changing directory to the one provided by ANDROID_ARGUMENT
I/python  (12951): /data/data/org.test.image_edit/files/app
I/python  (12951): Preparing to initialize python
I/python  (12951): _python_bundle dir exists
I/python  (12951): calculated paths to be...
I/python  (12951): /data/data/org.test.image_edit/files/app/_python_bundle/stdlib.zip:/data/data/org.test.image_edit/files/app/_python_bundle/modules
I/python  (12951): set wchar paths...
I/python  (12951): Initialized python
I/python  (12951): AND: Init threads
I/python  (12951): testing python print redirection
I/python  (12951): Android path ['.', '/data/data/org.test.image_edit/files/app/_python_bundle/stdlib.zip', '/data/data/org.test.image_edit/files/app/_python_bundle/mod
ules', '/data/data/org.test.image_edit/files/app/_python_bundle/site-packages']
I/python  (12951): os.environ is environ({'PATH': '/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin', 'ANDROID_BOOTLOGO': '1', 'ANDROID_ROOT': '/system', 'ANDROI
D_ASSETS': '/system/app', 'ANDROID_DATA': '/data', 'ANDROID_STORAGE': '/storage', 'ASEC_MOUNTPOINT': '/mnt/asec', 'LOOP_MOUNTPOINT': '/mnt/obb', 'BOOTCLASSPATH': '/syst
em/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/fr
amework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framew
ork/mms-common.jar:/system/framework/android.policy.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:
/system/framework/mediatek-telephony-common.jar', 'SYSTEMSERVERCLASSPATH': '/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi
-service.jar', 'USBOTG_STORAGE': '/storage/usbotg', 'LD_PRELOAD': 'libdirect-coredump.so', 'EXTERNAL_STORAGE': '/storage/emulated/legacy', 'SECONDARY_STORAGE': '/storag
e/sdcard1', 'EMULATED_STORAGE_SOURCE': '/mnt/shell/emulated', 'EMULATED_STORAGE_TARGET': '/storage/emulated', 'ANDROID_PROPERTY_WORKSPACE': '9,0', 'ANDROID_SOCKET_zygot
e': '10', 'ANDROID_ENTRYPOINT': 'main.pyc', 'ANDROID_ARGUMENT': '/data/data/org.test.image_edit/files/app', 'ANDROID_APP_PATH': '/data/data/org.test.image_edit/files/ap
p', 'ANDROID_PRIVATE': '/data/data/org.test.image_edit/files', 'ANDROID_UNPACK': '/data/data/org.test.image_edit/files/app', 'PYTHONHOME': '/data/data/org.test.image_ed
it/files/app', 'PYTHONPATH': '/data/data/org.test.image_edit/files/app:/data/data/org.test.image_edit/files/app/lib', 'PYTHONOPTIMIZE': '2', 'P4A_BOOTSTRAP': 'SDL2', 'P
YTHON_NAME': 'python', 'P4A_IS_WINDOWED': 'True', 'P4A_ORIENTATION': 'portrait', 'P4A_NUMERIC_VERSION': 'None', 'P4A_MINSDK': '21', 'LC_CTYPE': 'C.UTF-8'})
I/python  (12951): Android kivy bootstrap done. __name__ is __main__
I/python  (12951): AND: Ran string
I/python  (12951): Run user program, change dir and execute entrypoint
I/python  (12951): [WARNING] [Config      ] Older configuration version detected (0 instead of 21)
I/python  (12951): [WARNING] [Config      ] Upgrading configuration in progress.
I/python  (12951): [INFO   ] [Logger      ] Record log in /data/data/org.test.image_edit/files/app/.kivy/logs/kivy_20-09-17_0.txt
I/python  (12951): [INFO   ] [Kivy        ] v1.11.1
I/python  (12951): [INFO   ] [Kivy        ] Installed at "/data/data/org.test.image_edit/files/app/_python_bundle/site-packages/kivy/__init__.pyc"
I/python  (12951): [INFO   ] [Python      ] v3.7.5 (default, Sep 16 2020, 17:54:52)  
I/python  (12951): [Clang 8.0.2 (https://android.googlesource.com/toolchain/clang 40173bab62ec7462
I/python  (12951): [INFO   ] [Python      ] Interpreter at "android_python"
I/python  (12951): [INFO   ] [KivyMD      ] v0.104.1
I/python  (12951): [INFO   ] [Factory     ] 184 symbols loaded
I/python  (12951): [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
I/python  (12951): [INFO   ] [Window      ] Provider: sdl2
I/python  (12951): [INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
I/python  (12951): [INFO   ] [GL          ] Backend used <sdl2>
I/python  (12951): [INFO   ] [GL          ] OpenGL version <b'OpenGL ES 2.0'>
I/python  (12951): [INFO   ] [GL          ] OpenGL vendor <b'ARM'>
I/python  (12951): [INFO   ] [GL          ] OpenGL renderer <b'Mali-400 MP'>
I/python  (12951): [INFO   ] [GL          ] OpenGL parsed version: 2, 0
I/python  (12951): [INFO   ] [GL          ] Texture max size <4096>
I/python  (12951): [INFO   ] [GL          ] Texture max units <8>
I/python  (12951): [INFO   ] [Window      ] auto add sdl2 input provider
I/python  (12951): [INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
I/python  (12951): [INFO   ] [Text        ] Provider: sdl2
I/python  (12951): [INFO   ] [GL          ] NPOT texture support is available
I/python  (12951):  Traceback (most recent call last):
I/python  (12951):    File "/home/sahil/firstapp/.buildozer/android/app/main.py", line 15, in <module>
I/python  (12951):    File "/home/sahil/firstapp/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/image_edit/PIL/Image.py", line 69, in <module>
I/python  (12951):  ImportError: dlopen failed: cannot locate symbol "log" referenced by "_imaging.so"...
I/python  (12951): Python for android ended.


buildozer.spec
main.kv
main.py

Robert Flatt

unread,
Sep 17, 2020, 1:14:45 PM9/17/20
to Kivy users support
Things to try:

1) research if the missing file is in the apk
2) research where where the missing file is in Pillow
3) research buildozer options that change the filtering of files that are added to the apk

I don't have any specific experience with this one, so that is all I can suggest.

Degenerate Tech

unread,
Sep 17, 2020, 1:17:49 PM9/17/20
to Kivy users support
i have found something 

If it helps to someone else the specific file to solve this issue is:
.buildozer/android/platform/python-for-android/pythonforandroid/recipes/Pillow/__init__.py

and you must changle the line
env['CFLAGS'] += cflags

to this new line with the math flag:
env['CFLAGS'] += cflags + " -lm"

clean the python-for-android and rebuild.

buildozer android clean
buildozer android debug
Reply all
Reply to author
Forward
0 new messages