Skip to content Skip to sidebar Skip to footer

Python Kivy With Plyer App Crashes On Android (camera)

I develop kivy application using plyer. Build by buildozer and starting app on android succeeded, but application crashes when I push the button starting a camera, and nothing is o

Solution 1:

After investigating it, I understood that it crashed in plyer.platform.android.init.py.

It seemed to crash in activivity = PythonActivity.mActivity, but was not able to handle the exception.

--- plyer.platform.android.__init__.py ---

from os import environ
from jnius import autoclass

ANDROID_VERSION = autoclass('android.os.Build$VERSION')
SDK_INT = ANDROID_VERSION.SDK_INT

print('ANDROID_VERSION = {}'.format(SDK_INT))

if'PYTHON_SERVICE_ARGUMENT'in environ:
    print('test-1-1')
    PythonService = autoclass('org.renpy.android.PythonService')
    print('test-1-2')
    activity = PythonService.mService
    print('test-1-3')
else:
    print('test-2-1')
    PythonActivity = autoclass('org.renpy.android.PythonActivity')
    print('test-2-2')
    activity = PythonActivity.mActivity
    print('test-2-3')


--- logcat ---

I/python  ( 9384): AND: Ran string
I/python  ( 9384): Run user program, change dir and execute entrypoint
I/python  ( 9384): [WARNING] [Config      ] Older configuration version detected (0 instead of 16)
I/python  ( 9384): [WARNING] [Config      ] Upgrading configuration in progress.
I/python  ( 9384): Purge log fired. Analysing...
I/python  ( 9384): Purge finished!
I/python  ( 9384): [INFO   ] [Logger      ] Record login /data/data/org.test.cameraapp/files/app/.kivy/logs/kivy_16-12-16_0.txt
I/python  ( 9384): [INFO   ] [Kivy        ] v1.9.2-dev0
I/python  ( 9384): [INFO   ] [Python      ] v2.7.2 (default, Dec 16 2016, 19:14:20) 
I/python  ( 9384): [GCC 4.9.x 20150123 (prerelease)]
I/python  ( 9384): [INFO   ] [Factory     ] 193 symbols loaded
I/python  ( 9384): [INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
I/python  ( 9384): [INFO   ] [Text        ] Provider: sdl2
I/python  ( 9384): [INFO   ] [OSC         ] using <thread> for socket
I/python  ( 9384): [ERROR  ] [Input       ] AndroidJoystick is not supported by your version of linux
I/python  ( 9384): Traceback (most recent call last):
I/python  ( 9384):   File "/home/kivy/Documents/echizen-cyo/camera/.buildozer/android/platform/build/dists/cameraapp/private/lib/python2.7/site-packages/kivy/input/providers/__init__.py", line 57, in <module>
I/python  ( 9384):   File "/home/kivy/Documents/echizen-cyo/camera/.buildozer/android/platform/build/dists/cameraapp/private/lib/python2.7/site-packages/kivy/input/providers/androidjoystick.py", line 20, in <module>
I/python  ( 9384): Exception: android lib not found.
I/python  ( 9384): [INFO   ] [Window      ] Provider: sdl2
I/python  ( 9384): [INFO   ] [GL          ] OpenGL version <OpenGL ES   2.0>
I/python  ( 9384): [INFO   ] [GL          ] OpenGL vendor <ARM>
I/python  ( 9384): [INFO   ] [GL          ] OpenGL renderer <Mali-450 MP>
I/python  ( 9384): [INFO   ] [GL          ] OpenGL parsed version: 2, 0
I/python  ( 9384): [INFO   ] [GL          ] Texture max size <4096>
I/python  ( 9384): [INFO   ] [GL          ] Texture max units <8>
I/python  ( 9384): [INFO   ] [Window      ] auto add sdl2 input provider
I/python  ( 9384): [INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
I/python  ( 9384): [WARNING] [Base        ] Unknown <android> provider
I/python  ( 9384): [INFO   ] [Base        ] Start application main loop
I/python  ( 9384): [INFO   ] [GL          ] NPOT texture support is available
I/python  ( 9384): [ERROR  ] [Base        ] Could not remove android presplash
I/python  ( 9384): test
I/python  ( 9384): ANDROID_VERSION = 21
I/python  ( 9384): test-2-1
I/python  ( 9384): test-2-2

Solution 2:

This is bug in p4a/pyjnius. You can use old toolchain until it would be fixed.

Post a Comment for "Python Kivy With Plyer App Crashes On Android (camera)"