Kivy : Error weakly-referenced object (in a clock function) no longer exists

后端 未结 2 1099
故里飘歌
故里飘歌 2021-01-23 14:29

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

相关标签:
2条回答
  • 2021-01-23 14:38

    The official documentation (Kv language Programming Guide) says to add 'strong' references such as id_name: id_name.__self__ in the KV code, but it is unclear where this is necessary. What's more, it did not solve the ReferenceError: weakly-referenced object no longer exists errors for me.

    What did work is forcing Buildozer to use a specific version of hostpython3 by adding this to the requirements line of the buildozer.spec file:

    python3==3.7.5, hostpython3==3.7.5
    

    One more note: after adding the above to requirements, I went back and removed all my __self__ references and it still worked fine, so apparently these are no longer needed in Kivy KV language.

    Credit for this goes to the beautiful answer from leo10011.

    Update 2020-05-19: This bug reportedly has been fixed in Kivy 2.0.

    0 讨论(0)
  • 2021-01-23 14:46

    What I usually do to keep a reference to e.g. my_object is to add my_object: my_object.__self__ line in the kv part of my root rule.

    Since you haven't provide any code, I can't be more specific...

    0 讨论(0)
提交回复
热议问题