October 22, 2024
Chicago 12, Melborne City, USA
Android

Converting Kivy to apk


How can I troubleshoot my Kivy/KivyMD app crashing on Android after the loading screen? I’ve developed a simple app with the following code, and while it compiles successfully and the APK installs, it crashes immediately after the loading screen. My buildozer.spec file lists kivy==2.3.0, kivymd, pillow, and kivy_garden as requirements. I want to stick to Kivy/KivyMD for development and not switch to native or hybrid options. Any guidance/help would be appreciated!

from kivymd.app import MDApp
from kivy.lang import Builder

KV = '''
BoxLayout:
    orientation: 'vertical'
    MDLabel:
        text:" "
        halign:"center"
        
    MDRaisedButton:
        id: my_button
        text: 'Click me'
        pos_hint:{"center_x":0.5,"center_x":0.5}
        on_release: app.print_hello()
    MDLabel:
        id: output_label
        text: ''
        halign: 'center'
'''

class MyApp(MDApp):
    def build(self):
        return Builder.load_string(KV)

    def print_hello(self):
        self.root.ids.output_label.text = "Md Kasif"

if __name__ == '__main__':
    MyApp().run()

Tried including pillow and kivy_garden. I expected my app to load and work as it did in my compiler, but, it kept crashing after loading screen despite my multiple tries



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video