I'm developing a Flutter app, and it installs and runs perfectly fine when I deploy it to my mobile device directly from my development environment (like VS Code or Android Studio). However, once I stop the app and try to launch it again by tapping its icon on the home screen, the app fails to start.
What could be causing this issue, and how can I troubleshoot or resolve it?
Are you running your app on a real device or simulator?
If it is a real device, yes, you can't launch the app like that because the app stops connecting (when you stop the app) to Dart VM service like the image attached below
More info here
Just try to run on release mode flutter run --release
if you would like to do that
It is fine when run on a simulator
This is due to the way Flutter IDE works. App cannot be run after you disconnect it from debugging mode. However you can deploy it to Test Flight and then can run it without debugging by installing it from test flight.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With