You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be a recurrence of an issue that has been closed more than once. #148#730
Intermittent crash on "--orientation sensor" when phone rotated. Usually occurs within 3 rotates.
Removing the Window.bind() call disables the crash, but removes functionality
Adding a delay is a workaround, I don't know how reliable yet. Window.bind(size=Clock.schedule_once(self._resize_handler, 0.1))
A delay of 0.01 still crashes.
Thanks @inclement for the suggestion
from kivy.app import App
from kivy.uix.label import Label
from kivy.graphics import Color, Rectangle
from kivy.core.window import Window
class Demo(App):
def set_background_color(self):
with self.label.canvas.before:
Color(0.5, 0.0, 0.5)
Rectangle(size=Window.size)
def _resize_handler(self,obj,size):
self.set_background_color()
def build(self):
Window.bind(size=self._resize_handler)
self.label = Label(text = 'Greetings Earthlings')
self.set_background_color()
return self.label
if __name__ == '__main__':
Demo().run()
Thanks for the report, I think this is actually probably a different issue to the historical ones you mentioned, and it's good to know the specific cause relating to binding to Window when Window may not exist properly.
I suspect this needs a fix in Kivy itself, so I opened kivy/kivy#6277 about it.
I tested using kivy==master and the test app above, and also using a large app [after removing the Clock.schedule_once() workaround in both apps].
Both worked perfectly 'on rotate'. An 'on resume' crash is gone too.
Versions
Description
This seems to be a recurrence of an issue that has been closed more than once. #148 #730
Intermittent crash on "--orientation sensor" when phone rotated. Usually occurs within 3 rotates.
Removing the Window.bind() call disables the crash, but removes functionality
Adding a delay is a workaround, I don't know how reliable yet.
Window.bind(size=Clock.schedule_once(self._resize_handler, 0.1))
A delay of 0.01 still crashes.
Thanks @inclement for the suggestion
buildozer.spec
Command:
Spec file:
Logs
Logcat attached
logcat.txt
Phone is Pixel3
The tail of the backtrace says:
The text was updated successfully, but these errors were encountered: