Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Error weakly-referenced object no longer exists :(

576 views
Skip to first unread message

Biloba

unread,
May 7, 2020, 5:54:29 AM5/7/20
to Kivy users support
Hi !  So here is my error code
I think there's something hard in this error, i looked on forums but couldn't find out.

And ... i have the error on my phone (with kivy launcher python 3 and when i build with buildozer) but not on my computer (ubuntu or windows)
The error, from what i understand, comes from the garbage collector that delete a reference and the code try to access the reference after the garbage collector. but i am not sure if I rly understand the garbage collector thing

What i tried :
- make "strong references" so the gc dont delete it with id:
id.__self__ in my kv file

- make "strong references" with
self.refs = [
        self.id.__self__,
        self.id.__self__]

-Use the ErrorHandler to handle the error but the error keep coming for ever

What I think cause the error:
- the clock I use to send request to the server but i don't know why (self.requestClient is a function to send a request) :
C = Clock.schedule_interval(self.requestClient, 5)


Error :

[ERROR  ] Exception catched by ExceptionHandler
05-07 11:27:45.694  2788  2823 I python  : Traceback (most recent call last):
05-07 11:27:45.694  2788  2823 I python  :   File path/kivy-launcher/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/launcher/kivy/core/window/window_sdl2.py", line 747, in mainloop
05-07 11:27:45.694  2788  2823 I python  :   File "/path/kivy-launcher/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/launcher/kivy/core/window/window_sdl2.py", line 479, in _mainloop
05-07 11:27:45.694  2788  2823 I python  :   File "/path/kivy-launcher/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/launcher/kivy/base.py", line 339, in idle
05-07 11:27:45.694  2788  2823 I python  :   File "/path/kivy-launcher/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/launcher/kivy/clock.py", line 591, in tick
05-07 11:27:45.694  2788  2823 I python  :   File "kivy/_clock.pyx", line 384, in kivy._clock.CyClockBase._process_events
05-07 11:27:45.694  2788  2823 I python  :   File "kivy/_clock.pyx", line 414, in kivy._clock.CyClockBase._process_events
05-07 11:27:45.694  2788  2823 I python  :   File "kivy/_clock.pyx", line 412, in kivy._clock.CyClockBase._process_events
05-07 11:27:45.694  2788  2823 I python  :   File "kivy/_clock.pyx", line 154, in kivy._clock.ClockEvent.tick
05-07 11:27:45.694  2788  2823 I python  :   File "kivy/_clock.pyx", line 86, in kivy._clock.ClockEvent.get_callback
05-07 11:27:45.694  2788  2823 I python  :   File "/path/kivy-launcher/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/launcher/kivy/weakmethod.py", line 56, in is_dead
05-07 11:27:45.694  2788  2823 I python  : ReferenceError: weakly-referenced object no longer exists

Thanks for reading !

Robert Flatt

unread,
May 7, 2020, 1:19:42 PM5/7/20
to Kivy users support
I think this maybe a known issue related to Python 3.8 (and as you say garbage collection, so actually seeing the error is platform dependent)

Reading that page the fix is available in these Kivy versions: master, 2.0.0rc1 and 2.0.0rc2
Since all of these will involve other changes so I do not suggest a particular one.

There is another alternative, which is to tell Buildozer to use an older version of p4a that uses Python 3.7
I (and others) had other issues with this approach. I don't recommend trying it, but I suppose you might get lucky!
Reply all
Reply to author
Forward
0 new messages