No method named `Clear' in class java.lang.Boolean

I went back to modify an app that ran with no problems in the Companion and produced a working app file. When I ran it in the Companion this time I got a "invoke: no method named `Clear' in class java.lang.Boolean" error. But the compiled app seems to work fine despite the no method Clear warning.

It's a graphic app that draws linear equations of a line segment that the user can drag around the screen to see the y = mx + b equation for the segment.

The second screen "math_trap" is a game where the user must enclose a jumping frog sprite within a triangle of lines. The slope and y intercept for each equation must be entered to form the triangle.

The problem arises when in the Math Trap game, one goes back to Screen1, "Linear Explorer."

I tried the following:

  1. Deleting and re-installing the Android Companion app.
  2. Uploading the latest "properly" working version from my computer.
  3. Messing around with the code.
  4. Checking with closing and opening screens code. My strategy for going from Screen_1 to math_trap was to just open the math_trap. To go back to Screen1, I close math_trap and the app defaults to Screen1, already still open.
  5. Searched for similar problems using Google and the App Inventor Community.

I use the canvas clear operation repeatedly.

Explore_Mtrap_2.aia (1.4 MB)

What might cause the error message?
Is there a way to trap the error?


Do you use any clocks on the Math Trap screen?


I don't see any event block in Screen1 to catch When Other Screen Closed.
Also, like Patryk_F hinted at, Clocks need to be turned off before switching Screens.

By The Way, I didn't know you could embed spaces and special characters in an app name:

Disabling the Clock Timers helped me when switching screens in your app ...

I didn't address any possible need to reset things in Screen1 after returning from math_trap screen.

THAT WORKED!!! Many thanks.

I turned off the clocks before switching screens as suggested by your question and more explicit suggestions from ABG. IT WORKED!
Many thanks for the response.