We are facing a strange issue after updating our project from Flutter 3.24.5 → Flutter 3.35.6.

After installing the app from App Store or TestFlight, when the user opens the app and then force-kills it multiple times, the app sometimes gets permanently stuck on a black screen at launch.

Important Notes

  • This issue does NOT happen on Flutter 3.24.5 — works perfectly on all tested iOS devices.
  • The problem started only after migrating to Flutter 3.35.6.
  • This issue happens only in real production installs (App Store / TestFlight).
  • It does not reproduce easily in Debug mode or through Xcode run / Android Studio run.

Steps to Reproduce

  1. Install the app from App Store or TestFlight
  2. Launch the app
  3. Force-kill the app using app switcher
  4. Repeat launch + kill multiple times
  5. After 3–7 attempts, app gets stuck on black screen on launch

It feels like the app gets stuck because some data gets corrupted or some data gets into an invalid state. I think killing the app triggers the corruption or the invalid state.

Things that comes to mind are:

  • Shorebird
  • Ephemeral state solutions like RestorationManager or hydrated_bloc

I would start logging the whole app boot process to methodically narrow down the issue.

1 Like

I’ve had issues with blank screens on start-up if I have an exception in state restoration. This could be very frustrating, as killing the app would not reset the faulty state restoration, so it’d just try again and return to the blank screen.

I ended up setting up a 15-second timer in main that calls exit() if it does not receive a notification from the home screen that initState had been reached. On restart, it then uses a new restorationScopeId for MaterialApp so that the borked restoration is abandoned.

1 Like