Kivy application runtime crash with exceptions on click of buttons

67 views
Skip to first unread message

Aravind R

unread,
Nov 19, 2022, 12:40:41 PM11/19/22
to Kivy users support
It works good in IDE. Application was build successfully. It behaves really weird in runtime. On click of any button causes an runtime exception. I have attached a recording for the reference : video link . p4a is master version as per default in spec file and ran buildozer as non-root user and webview used is Android-for-Python. Please find all necessary files including source code file, apk that got built, buildozer.spec used, buildozer logcat logs, dependency images and lotty file in link. I don't know how to proceed further. I was blocked with this for months. Please help me resolve this issue. Please reply if you need any other information from my side. Any help is appreciated.

Robert

unread,
Nov 19, 2022, 3:58:40 PM11/19/22
to Kivy users support
Cant read any file in the link.

If you are using KivyMD  https://github.com/Android-for-Python/Android-for-Python-Users#null-pointer-dereference

Aravind R

unread,
Nov 26, 2022, 12:25:14 AM11/26/22
to Kivy users support
I am not able to find the root cause. Here are my source files. Please support me to trace the root cause.
buildozer.spec
main.py

Robert

unread,
Nov 26, 2022, 1:01:59 AM11/26/22
to Kivy users support
I don't debug other people's apps, all I ever do is try to point people in what I think is a helpful direction. The rest is up to you.

But I do suggest you read the link I previously shared.

Aravind R

unread,
Nov 26, 2022, 1:27:23 AM11/26/22
to Kivy users support
Hi Robert,
          I am not asking you to debug.There is no impure package in my code. None of this really applicable in my case as specified in my link.
  • A corrupted build try an appclean. This probably it not the issue but if it is you'll save a lot of work. -- I tried this but doesn't help

  • Pyjnius code that does not take into account the use of two garbage collectors, modify your code. --  I am using this in place but https://github.com/Android-for-Python/Webview-Example

            def copyrightNoticeButtonRelease(instance):
                platformName = platform.system()
                copyrightNoticeUrl = "https://sites.google.com/view/copyright-notices/home"
                if platformName in ["Windows", "Linux"]:
                    import webbrowser
                    webbrowser.open(copyrightNoticeUrl)
                else:
                    try:
                        from webview import WebView
                        WebView(copyrightNoticeUrl)
                    except:
                        showDialog(text = "Technical issues in showing the copyright notices")
    I think this pyjnius code doesn't cause any trouble. In fact this part works fine in app build even now.

  • Plyer or android_permissions calls that do not occur in the 'App functions' block of the Kivy Lifecycle. Modify your code.
    # (list) Permissions
    android.permissions = INTERNET
    I have already set up the permissions as well.

  • It is also possible that an impure Python package that has no recipe could generate this error; though other error messages or are more likely.
    from kivymd.app import MDApp
    from kivymd.uix.floatlayout import MDFloatLayout
    from kivymd.uix.textfield import MDTextField
    from kivymd.uix.button import MDFillRoundFlatButton
    from kivymd.uix.button import MDIconButton
    from kivymd.uix.dialog import MDDialog
    from kivy.uix.image import Image
    from kivymd.uix.fitimage import FitImage
    from kivymd.uix.button import MDFlatButton
    from kivymd.uix.card import MDCard
    from kivymd.uix.screen import MDScreen
    from kivy.uix.screenmanager import ScreenManager
    from kivy.uix.screenmanager import FadeTransition
    from kivy.uix.scrollview import ScrollView
    import platform
    from kivymd.uix.list import MDList
    from kivymd.uix.list import OneLineIconListItem
    from kivymd.uix.label import MDLabel
    from kivy.core.window import Window

    I have only these imported in my app. There is no impure python modules.

    Now I am again completely stuck with it. Can you suggest me some other ways ?


Toon to Tech

unread,
Nov 26, 2022, 10:36:21 AM11/26/22
to kivy-...@googlegroups.com
Tried with API level : 32 and p4a.branch as develop. But that doesn't help either. Can you tell me any other ways to resolve this ?

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/a5cccffe-5e6d-4ca5-a604-0fac8de9575fn%40googlegroups.com.

Robert

unread,
Nov 26, 2022, 12:22:53 PM11/26/22
to Kivy users support
First thing to try read where it says "ALERT" in the link.

Toon to Tech

unread,
Nov 26, 2022, 9:52:27 PM11/26/22
to kivy-...@googlegroups.com
I am using kivymd 1.0.2

Robert

unread,
Nov 26, 2022, 10:26:17 PM11/26/22
to Kivy users support
Your buildozer.spec says this is not the case

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy,kivymd,PIL,android,jnius

Toon to Tech

unread,
Nov 26, 2022, 10:47:57 PM11/26/22
to kivy-...@googlegroups.com
Oops I think I looked in the wrong place. Let me try a build with kivymd 1.0.2 and get back here.

Toon to Tech

unread,
Nov 26, 2022, 11:33:28 PM11/26/22
to kivy-...@googlegroups.com
Hi Robert,
      I retried the build with kivymd 1.0.2. It was a successful build. I can use my application completely now. Then this issue was version specific. I hope you guys will take care of it. Thanks a lot for your support :) .

Robert

unread,
Nov 27, 2022, 12:01:54 PM11/27/22
to Kivy users support
KivyMD is an unrelated project, all the Kivy project can do is post warnings.  :(
Reply all
Reply to author
Forward
0 new messages