Search code examples
androidpython-3.xkivywindows-subsystem-for-linuxbuildozer

SOLVED: Buildozer kivy App crashes on Android right after opening


I wanted to create an app with kivy/kivyMD i created a simple "Hello Wolrd!" just to verify that everything was setup right and the APK builded correctly. I followed all the steps on buildozer quickstart page (I'm building on Windows using WSL) but for some reason I can't get the adb on WSL to see my device (I have the same adb version both on Windows and on WSL already). The APK is built and installed just fine, but when I try to open it I just see the Kivy loading screen and then it crashes.

main.py file:

from kivymd.app import MDApp
from kivymd.uix.label import MDLabel

class MainApp(MDApp):
    def build(self):
        return MDLabel(text= "Hello World!", halign= "center")

MainApp().run()

The only changes to the buildozer.spec file I did are adding the kivymd requirement and set kivy==2.0.0 as I saw in other similar posts, but unfortunately it didn't work for me. I couldn't post the terminal log here, due to characters limitation, but note that I have to run buildozer as root or else I'll get an error and the app won't be built. Sorry for the bad grammar, English is not my first language.


Solution

  • To be able to read the logcat I had to install linux on my pc and transfer the whole project to the new OS. Anyway I found out the problem: I NEEDED TO ADD PILLOW TO MY REQUIREMENTS. Even though I didn't have any image in my app, i think kivy needs it to like set up everything, idk how the render things works.