I have created a Xamarin.Forms app with Android and iOS projects. The Android build appears to run fine, but the iOS build occasionally crashes and I am struggling to pin down the cause, as no crash log is produced and no exception is reported in the application output.
The app accepts input from a Bluetooth-connected barcode scanner and (after some validation) displays it and writes it to a local SQLite database, accessed using SQLite.NET. A worker process also periodically synchronizes the local database with a central database via a REST API call.
Under heavy load (non-stop barcode scanning) the app crashes after typically 200 or 300 barcodes have been scanned. The crash appears to occur when a barcode scan coincides with a REST API call (although I have not been able to conclusively prove this). I don't believe this is a thread safety issue, as I have implemented the SQLite recommended pattern of accessing the database via dedicated SQLiteConnection instances for each thread (but I am happy to be corrected if I have got this wrong).
I am puzzled how such a crash can occur, leaving absolutely no evidence of its cause. Is there somewhere else I should be looking for the evidence, apart from within Xcode's Devices window? Shouldn't I expect an exception to be reported in the application output, while debugging?
I have implemented logging handlers for AppDomain.CurrentDomain.UnhandledException and TaskScheduler.UnobservedTaskException but they don't appear to be called. Is there some other way I can instrument my code to trap the cause of this crash?
Many thanks for your advice,