I just made a new flutter project and run the defalut app that comes with it. First run went smoothly but every run after that showed a white screen after the splash screen. Seeing that terminal still displayed messages when I click where the "increase the counter" button is supposed to be, the UI still worked just wasn’t displayed.
Cleaning the build did nothing, doctor said everything is good and there were no errors when running the app. Only way to show the UI again was to uninstall the app from the emulator and run flutter again, but after the first run the app still goes white no matter if I restart the run or exit the app and close it. It would be nice not have to do that every time I want to run the app but my main concern is that it will stay that way when I finish with development and build the app. Any help is much appreciated
UPDATE:
I’m starting to get scared. When I entered the app after closing it I got this on my screen and I’m not sure what kind of demons am I conjuring
2
Answers
This issue usually happens with the android emulator and the same build works fine on a physical device.
Try to run following commands to clean and rebuild the project (it might help):
As you can see from the top banner on the screen, its a debug build.
Please run your app in release mode using
flutter run --release
The build settings should be updated in build.gradle files.
refer to https://docs.flutter.dev/deployment/android , from signing the app.