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 output in logcat. I work without a problem when I carry out the same code in kivylauncher. It was similar even if I tested it with an accelerometer.
I think that necessary setting may be short when I build application using plyer.
--- source code ---
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.label import Label
from plyer import camera
class UI(FloatLayout):
def __init__(self, **kwargs):
super(UI, self).__init__(**kwargs)
self.lblCam = Label(text="Click to take a picture")
self.add_widget(self.lblCam)
def on_touch_down(self, e):
try:
print('test')
camera.take_picture('/storage/sdcard0/example.jpg', self.done)
except NotImplementedError:
print("This feature has not yet been implemented for this platform")
except Exception as e:
print(str(type(e)))
def done(self, e):
self.lblCam.text = e
class Camera(App):
def build(self):
ui = UI()
return ui
def on_pause(self):
return True
def on_resume(self):
pass
Camera().run()
--- buildozer.spec ---
(buildozer android_new debug)
requirements = plyer,kivy,python2
android.permissions = CAMERA
android.api = 22
android.minapi = 21
android.sdk = 22
android.ndk = 13b
android.bootstrap = sdl2
--- environments
buildozer: 0.33dev
android (device)version: 5.0.2
--- adb logcat -s python ---
I/python (30711): AND: Ran string
I/python (30711): Run user program, change dir and execute entrypoint
I/python (30711): [WARNING] [Config ] Older configuration version detected (0 instead of 16)
I/python (30711): [WARNING] [Config ] Upgrading configuration in progress.
I/python (30711): [INFO ] [Logger ] Record log in /data/data/org.test.cameraapp/files/app/.kivy/logs/kivy_16-12-15_0.txt
I/python (30711): [INFO ] [Kivy ] v1.9.2-dev0
I/python (30711): [INFO ] [Python ] v2.7.2 (default, Dec 15 2016, 13:03:19)
I/python (30711): [GCC 4.9.x 20150123 (prerelease)]
I/python (30711): [INFO ] [Factory ] 193 symbols loaded
I/python (30711): [INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
I/python (30711): [INFO ] [Text ] Provider: sdl2
I/python (30711): [INFO ] [OSC ] using <thread> for socket
I/python (30711): [ERROR ] [Input ] AndroidJoystick is not supported by your version of linux
I/python (30711): Traceback (most recent call last):
I/python (30711): 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 (30711): 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 (30711): Exception: android lib not found.
I/python (30711): [INFO ] [Window ] Provider: sdl2
I/python (30711): [INFO ] [GL ] OpenGL version <OpenGL ES 2.0>
I/python (30711): [INFO ] [GL ] OpenGL vendor <ARM>
I/python (30711): [INFO ] [GL ] OpenGL renderer <Mali-450 MP>
I/python (30711): [INFO ] [GL ] OpenGL parsed version: 2, 0
I/python (30711): [INFO ] [GL ] Texture max size <4096>
I/python (30711): [INFO ] [GL ] Texture max units <8>
I/python (30711): [INFO ] [Window ] auto add sdl2 input provider
I/python (30711): [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
I/python (30711): [WARNING] [Base ] Unknown <android> provider
I/python (30711): [INFO ] [Base ] Start application main loop
I/python (30711): [INFO ] [GL ] NPOT texture support is available
I/python (30711): [ERROR ] [Base ] Could not remove android presplash
I/python (30711): test
I am worried about "Exception: android lib not found.".
This is bug in p4a/pyjnius. You can use old toolchain until it would be fixed.