I have a Flutter application which crashes when run from the command line or from XCode, but works fine when debugging via VSCode. It is entirely reproducable, happens on the same physical device. The only tool that I have to track errors is Raygun, and while Raygun detects and logs the exception, the exception does not occur when debugging.
I can use VSCode to debug, set exceptions, break on all/uncaught exceptions etc. What is happening is that when I use VSCode to debug the application, the behaviour of the app changes enough that the bug does not appear.
If I use XCode to open the Runner project and run the app, XCode spends approx 5 minutes compiling, runs it on my device, and then I see the problem.
If I use the command line flutter run --device-id 00008101-XXXXMYDEVICEIDHEREXXX --debug, then flutter spends approx 2 minutes compiling (again), runs it on my device, and then again - I see the problem.
If I switch to VSCode and launch the debug application, VSCode spends 2 minutes compiling (yet again), runs it on my device, and the bug does not appear.
This suggests that the VSCode flutter compile process is doing something different.