Compiled MIT App inventor APK app always reverts back to main screen after a few seconds

My MIT App Inventor apps work normally in the AI2 Companion. However, after compiling them into APK files, they always return back to the main screen after a few seconds. Is this a bug in MIT App Inventor or did I make a mistake in my app?

Two possibilities:

  • TinyDB is shared among different apps when using the Companion, not when running a compiled app. An improper TinyDB default could be at fault.
  • Screen switching is different between the Companion and a compiled app.

If that doesn't help, post an .aia