App Crashes When Opening

Whenever I try to open my app in the AI Companion, it crashes immediately and the error doesn't show on App Inventor. There are also no warnings. Is there anything in the code that's preventing it from opening?

I think the problem is here :
de765c58866fd92930b835e92bc3f50ed2db5832

1 Like

Besides fixing the aforementioned bug, turn off your Clock Timers in the Designer and don't start them until the player starts a game.

1 Like

Thanks for your help. I just fixed both of those bugs, but the app is still crashing.

AI companion is up-to-date?

Have you tried the application on your cellphone?

I ran the companion on my phone. It works just fine with other apps. As soon as I scan the code and it loads, the app flickers on my screen for a moment before the companion app crashes.

Hello CJ

In the Screen Initialization Block, you do not allow any time for the Initialization to complete. Try moving the call to procedure newGame to the bottom of the Screen Initialization Block.

If that does not stop the crash, Enable a timer at the bottom of the Screen Initialization Block, say 500 millis, and use that timer to:

a) Disable itself
b) call the procedure newGame

It is good practice to initialize (but not start) all your Timers in the Screen Initialization Block (last items in the Block). Always ensure that "TimerAlwaysFires" is false. Ensure the Timers are not activated via the Designer Attributes palette too.

1 Like

Thank you for your help, it worked.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.