Some of Kivymd Projects Crash (Android 12)

197 views
Skip to first unread message

Ginda Wijaya

unread,
Jan 18, 2023, 4:21:15 PM1/18/23
to Kivy users support
Hi all, needs help.

1. All projects written in native kivy are Ok, but some of kivymd crashed
2. All Apk successfully build, both kivy & kivymd 
3.  The problem comes up when i run Apk written in kivymd using Android 12 phone. Here's the debug code in adb logcat & pydroid 3

====================

[INFO ] Logger: Record log in /storage/emulated/0/Download/ubuntubox/kivymd_ex/.kivy/logs/kivy_23-01-18_0.txt
[WARNING] [Config ] Upgrading configuration in progress.
[WARNING] [Config ] Older configuration version detected (0 instead of 21)
[INFO ] Kivy: v2.0.0
[INFO ] Kivy: Installed at "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/kivy/__init__.py"
[INFO ] Python: v3.9.7 (default, Oct 6 2021, 01:34:26) 
[GCC 11.1.0]
[INFO ] Python: Interpreter at "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/bin/python3"
[INFO ] Factory: 186 symbols loaded
[INFO ] KivyMD: 1.1.1, git-Unknown, 2022-12-31 (installed at "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/kivymd/__init__.py")
[INFO ] Image: Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] Text: Provider: sdl2
[INFO ] Window: Provider: sdl2
[INFO ] GL: Using the "OpenGL ES 2" graphics system
[INFO ] GL: Backend used <sdl2>
[INFO ] GL: OpenGL version <b'OpenGL ES 3.2 V@0502.0 (GIT@3d24e2bbef, I3c0bc64a9d, 1636541542) (Date:11/10/21)'>
[INFO ] GL: OpenGL vendor <b'Qualcomm'>
[INFO ] GL: OpenGL renderer <b'Adreno (TM) 610'>
[INFO ] GL: OpenGL parsed version: 3, 2
[INFO ] GL: Texture max size <16384>
[INFO ] GL: Texture max units <16>
[INFO ] Window: auto add sdl2 input provider
[INFO ] Window: virtual keyboard not allowed, single mode, not docked
[WARNING] Base: Unknown <android> provider
[INFO ] Base: Start application main loop
[INFO ] GL: NPOT texture support is available

=====

It happened when i ran this code

=======

from kivy.lang import Builder

from kivymd.app import MDApp
from kivymd.uix.tab import MDTabsBase
from kivymd.uix.floatlayout import MDFloatLayout
from kivymd.icon_definitions import md_icons

KV = '''
MDBoxLayout:
    orientation: "vertical"

    MDTopAppBar:
        title: "Example Tabs"

    MDTabs:
        id: tabs
        on_tab_switch: app.on_tab_switch(*args)


<Tab>

    MDIconButton:
        id: icon
        icon: root.icon
        icon_size: "48sp"
        pos_hint: {"center_x": .5, "center_y": .5}
'''


class Tab(MDFloatLayout, MDTabsBase):
    '''Class implementing content for a tab.'''


class Example(MDApp):
    icons = list(md_icons.keys())[15:30]

    def build(self):
        return Builder.load_string(KV)

    def on_start(self):
        for tab_name in self.icons:
            self.root.ids.tabs.add_widget(Tab(icon=tab_name))

    def on_tab_switch(
        self, instance_tabs, instance_tab, instance_tab_label, tab_text
    ):
        '''
        Called when switching tabs.

        :type instance_tabs: <kivymd.uix.tab.MDTabs object>;
        :param instance_tab: <__main__.Tab object>;
        :param instance_tab_label: <kivymd.uix.tab.MDTabsLabel object>;
        :param tab_text: text or name icon of tab;
        '''
        # get the tab icon.
        count_icon = instance_tab.icon
        # print it on shell/bash.
        print(f"Welcome to {count_icon}' tab'")


Example().run()

=========


Robert

unread,
Jan 18, 2023, 6:11:17 PM1/18/23
to Kivy users support
You have I expect found a known issue, the workaround and the explanation are the same as this error message (it also applies to KivyMD 1.1.1)
Reply all
Reply to author
Forward
0 new messages