Companion App Randomly Crashes When Switching Screens

I am working on a school project and my app has 5 different screens, and when I switch between them there is roughly a 50% chance that the app just crashes with no useful error messages. Any thoughts on what is going on?timer_app_remastered.aia (28.6 KB)

Be sure to disable each screen's clocks before switching screens.

By the way, how are you switching screens in the Companion?

  • using the buttons in Screen1 and the Back button in other screens, or
  • using the Screen pulldown in the Designer or Blocks Editor?

Sending a TinyDB Namespace to another screen as a Start value is risky in the Companion, if you switch screens from the AI2 web site. I advise sticking to simple TinyDB1 with its stock NameSpace.

Your app is simple enough to stack the contents of all the other screens as vertical Arrangements in Screen1, only one visible at a time.

Screen1 recommendation if you stay with multiple screens:

Timer screen:

Active timer screen:

Stopwatch screen:

The ,aia file:
timer_app_remastered_ABG.aia (29.2 KB)

I also removed the NamesPace code, just leaving a consistent TinyDB across screens.


This actually did occur to me, but it didn't help the problem

See my re-editted prior post.

1 Like

...also test your App as an APK.

1 Like

I've seen this solution elsewhere, unfortunately I'm on iOS so I am stuck with the companion app

Thank you for the suggestions on this, but unfortunately your aia still has the problem where the companion app crashes when the Active_Timer_Screen is closed (that one seems to be the most problematic, but it happens to all of them)

  • using the buttons in Screen1 and the Back button in other screens, or
  • using the Screen pulldown in the Designer or Blocks Editor?

I had a "reset" button on ActiveTimerScreen that would shut off the timer and run the "close screen" command, but I removed it because I thought it was the problem (clearly not)

For the stopwatch and timer setting screen I was using the back button at the top

for context, here is a video of the app crashing after trying to return to the timer set screen

You should have mentioned that in your topic.

I changed it.

Didn't realize there were separate categories, mb

Post your last customized version (aia). I'll check it out on my iOS test devices later.

timer_app_remastered_ABG (1).aia (29.3 KB)
This is the latest version of my app

Ok, what are your test devices? iOS version?

iPhone SE 2 running iOS 15
The interface is designed for a 750x1334 pixel screen (my phone)

After a lot of switching this began to occur. From that moment on it happened also with the other screens.

Switching screens in the companion can give errors in Android and iOS.

I tested in Android and there the empty alarm screen is able to close the companion. So when i swipe there to go back the companion closes.

In iOS a lot of switching between screen1 and the empty alarm screen also closes the companion.