iOS crash in UIKit on main thread

Hello all.

We have been experiencing a crash that we have not been able to track down since the launch of our iOS app on the Apple App Store. iTunes Connect lists a very high rate of crashes for our application, even though in testing over testflight we are not able to reproduce any crashes.

The crash can never be reproduced with the Xcode debugger connected, but the performance reporting logs in unity analytics for our app have a large number of these crashes (10000+ and counting):

Thread 0 (crashed)
0 libsystem_kernel.dylib __pthread_kill
1 libsystem_c.dylib abort
2 libsystem_malloc.dylib szone_size
3 libc++.1.dylib std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::~basic_string()
4 libsystem_c.dylib __cxa_finalize_ranges
5 libsystem_c.dylib exit
6 UIKit -[UIApplication applicationWillTerminate]
7 UIKit __98-[__UICanvasLifecycleMonitor_Compatability deactivateEventsOnly:withContext:forceExit:completion:]_block_invoke.271
8 UIKit _runAfterCACommitDeferredBlocks
9 UIKit _cleanUpAfterCAFlushAndRunDeferredBlocks
10 UIKit _afterCACommitHandler
11 CoreFoundation CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
12 CoreFoundation __CFRunLoopDoObservers
13 CoreFoundation __CFRunLoopRun
14 CoreFoundation CFRunLoopRunSpecific
15 GraphicsServices GSEventRunModal
16 UIKit UIApplicationMain
17 dubface main
18 libdyld.dylib start

The app has been built with Unity 2017.1.1p1, but the crash was present also in 2017.1.0p4

If there is anyone who could shed some light on even what stage of the application lifetime this should be happening, it would be helpful!

Thank you

Hi, did you find I fix for this? I’m getting the UIKit crash now too.

Hi. We have same crashes too. Our app was builded in 2017.4.12f1