title: How do I fix a ReferenceError in my KivyMD app?
body: <p>I created a KivyMD app and tried running it on an Android device. The app is a game called COVID Killers. There's a start screen, game screen, and a game over screen. In the start screen you start the game. In the game screen, there are viruses and you have to hit them with bars of soap. In the game over screen there's a game over GIF and you can click a button to restart the game. On an Android device, when I throw a bar of soap the soap goes up to the virus but as soon as it hits the virus the app crashes. I already posted another question about this app <a href="https://stackoverflow.com/questions/63079352/kivymd-mdflatbutton-not-clickable-kivy-screenmanager-not-working" title="python - KivyMD MDFlatButton not clickable &amp; Kivy ScreenManager not working">KivyMD MDFlatButton not clickable &amp; Kivy ScreenManager not working</a> when I was still coding it. But I fixed the app eventually. So since the app crashes on Android, I looked at the ADB log, and saw this traceback:</p>
  <pre class="lang-py prettyprint-override"><code>07-25 14:24:01.802 14777 14870 I python  :  Traceback (most recent call last):
  07-25 14:24:01.802 14777 14870 I python  :    File &quot;~/MEGAsync/KivyLab/KivyMD/COVIDKillers/.buildozer/android/app/main.py&quot;, line 427, in &lt;module&gt;
  07-25 14:24:01.803 14777 14870 I python  :    File &quot;~/MEGAsync/KivyLab/KivyMD/COVIDKillers/.buildozer/android/platform/build-arm64-v8a/build/python-installs/COVIDKillers/kivy/app.py&quot;, line 855, in run
  07-25 14:24:01.803 14777 14870 I python  :    File &quot;~/MEGAsync/KivyLab/KivyMD/COVIDKillers/.buildozer/android/platform/build-arm64-v8a/build/python-installs/COVIDKillers/kivy/base.py&quot;, line 504, in runTouchApp
  07-25 14:24:01.803 14777 14870 I python  :    File &quot;~/MEGAsync/KivyLab/KivyMD/COVIDKillers/.buildozer/android/platform/build-arm64-v8a/build/python-installs/COVIDKillers/kivy/core/window/window_sdl2.py&quot;, line 747, in mainloop
  07-25 14:24:01.803 14777 14870 I python  :    File &quot;~/MEGAsync/KivyLab/KivyMD/COVIDKillers/.buildozer/android/platform/build-arm64-v8a/build/python-installs/COVIDKillers/kivy/core/window/window_sdl2.py&quot;, line 479, in _mainloop
  07-25 14:24:01.803 14777 14870 I python  :    File &quot;~/MEGAsync/KivyLab/KivyMD/COVIDKillers/.buildozer/android/platform/build-arm64-v8a/build/python-installs/COVIDKillers/kivy/base.py&quot;, line 348, in idle
  07-25 14:24:01.804 14777 14870 I python  :    File &quot;~/MEGAsync/KivyLab/KivyMD/COVIDKillers/.buildozer/android/platform/build-arm64-v8a/build/python-installs/COVIDKillers/kivy/clock.py&quot;, line 598, in tick_draw
  07-25 14:24:01.804 14777 14870 I python  :    File &quot;kivy/_clock.pyx&quot;, line 427, in kivy._clock.CyClockBase._process_events_before_frame
  07-25 14:24:01.804 14777 14870 I python  :    File &quot;kivy/_clock.pyx&quot;, line 467, in kivy._clock.CyClockBase._process_events_before_frame
  07-25 14:24:01.804 14777 14870 I python  :    File &quot;kivy/_clock.pyx&quot;, line 465, in kivy._clock.CyClockBase._process_events_before_frame
  07-25 14:24:01.804 14777 14870 I python  :    File &quot;kivy/_clock.pyx&quot;, line 154, in kivy._clock.ClockEvent.tick
  07-25 14:24:01.805 14777 14870 I python  :    File &quot;kivy/_clock.pyx&quot;, line 86, in kivy._clock.ClockEvent.get_callback
  07-25 14:24:01.805 14777 14870 I python  :    File &quot;~/MEGAsync/KivyLab/KivyMD/COVIDKillers/.buildozer/android/platform/build-arm64-v8a/build/python-installs/COVIDKillers/kivy/weakmethod.py&quot;, line 56, in is_dead
  07-25 14:24:01.805 14777 14870 I python  :  ReferenceError: weakly-referenced object no longer exists
  07-25 14:24:01.805 14777 14870 I python  : Python for android ended.
  </code></pre>
  <p>There was also a Java error. Since the error is <strong>really</strong> long, here is a link to it: <a href="https://docs.google.com/document/d/14abjob6NQ5pibuAPpOd4gpOs4lMexf88PTMW5uEul8Q/edit?usp=sharing" rel="nofollow noreferrer" title="Java Error - Google Docs">Java Error</a></p>
  <p>Does anybody know what's causing my app to crash? If anyone needs to view the code of my app, I will leave a link to it.</p>
  <p>Thanks in advance!</p>