If I background the app and then foreground, I get an ArgumentNullException that doesn't seem to touch my code. What could I be doing wrong? Or should I log a bug?
ios:13.5.1
Xamarin.Forms 4.7.0.1080
Xamarin 16.6.000.1062 (d16-6@41e1f0e)
Xamarin.iOS and Xamarin.Mac SDK 13.18.2.1 (29c4ea7)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Stack Trace from Debugger:
System.ArgumentNullException
Value cannot be null.
Parameter name: enumerable
at Xamarin.Forms.Internals.EnumerableExtensions.IndexOf[T] (System.Collections.Generic.IEnumerable1[T] enumerable, T item) [0x00003] in <d38e76fdc23646f49d3b65e0bfb375de>:0 at Xamarin.Forms.Application.OnRequestedThemeChanged (Xamarin.Forms.AppThemeChangedEventArgs args) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Application.cs:172 at Xamarin.Forms.Platform.iOS.PageRenderer.TraitCollectionDidChange (UIKit.UITraitCollection previousTraitCollection) [0x00021] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:373 at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:86 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:65 at RemoteApp.Forms.iOS.Application.Main (System.String[] args) [0x00001] in /Users/collinfe/Documents/UnifyVehicleRemote/src/RemoteApp.Forms.iOS/Main.cs:17
Native crash log:
Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Triggered by Thread: 0 Thread 0 name: tid_407 Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x0000000189d9dd88 __pthread_kill + 8 1 libsystem_pthread.dylib 0x0000000189cb61e8 pthread_kill$VARIANT$mp + 136 2 libsystem_c.dylib 0x0000000189c099b0 __abort + 112 3 libsystem_c.dylib 0x0000000189c09940 __abort + 0 4 RemoteApp.Forms.iOS 0x00000001072bf774 xamarin_printf + 79918964 (runtime.m:2468) 5 RemoteApp.Forms.iOS 0x000000010718a634 mono_invoke_unhandled_exception_hook + 78652980 (exception.c:1299) 6 RemoteApp.Forms.iOS 0x0000000107127e80 mono_handle_exception_internal + 78249600 (mini-exceptions.c:2783) 7 RemoteApp.Forms.iOS 0x0000000107126868 mono_handle_exception + 78243944 (mini-exceptions.c:3107) 8 RemoteApp.Forms.iOS 0x000000010711d334 mono_arm_throw_exception + 78205748 (exceptions-arm64.c:401) 9 RemoteApp.Forms.iOS 0x00000001030c0edc throw_exception + 172 10 RemoteApp.Forms.iOS 0x000000010341addc Xamarin_Forms_Internals_EnumerableExtensions_IndexOf_T_REF_System_Collections_Generic_IEnumerable_1_T_REF_T_REF + 14233052 (/D:\a\1\s\Xamarin.Forms.Core\EnumerableExtensions.cs:81) 11 RemoteApp.Forms.iOS 0x000000010316e310 Xamarin_Forms_Application_OnRequestedThemeChanged_Xamarin_Forms_AppThemeChangedEventArgs + 11428624 (/D:\a\1\s\Xamarin.Forms.Core\Application.cs:172) 12 RemoteApp.Forms.iOS 0x0000000105f9a98c Xamarin_Forms_Platform_iOS_PageRenderer_TraitCollectionDidChange_UIKit_UITraitCollection + 59845004 (/D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:375) 13 RemoteApp.Forms.iOS 0x0000000103003860 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 272 14 RemoteApp.Forms.iOS 0x0000000107138388 mono_jit_runtime_invoke + 78316424 (mini-runtime.c:3165) 15 RemoteApp.Forms.iOS 0x00000001071e65d4 mono_runtime_invoke_checked + 79029716 (object.c:3220) 16 RemoteApp.Forms.iOS 0x00000001071e9a3c mono_runtime_invoke + 79043132 (object.c:3107) 17 RemoteApp.Forms.iOS 0x000000010268ce48 native_to_managed_trampoline_5(objc_object*, objc_selector*, _MonoMethod**, objc_object*, unsigned int) + 20040 (registrar.m:228) 18 RemoteApp.Forms.iOS 0x000000010270e494 -[Xamarin_Forms_Platform_iOS_PageRenderer traitCollectionDidChange:] + 550036 (registrar.m:49197) 19 UIKitCore 0x000000018da0a308 -[UIViewController _traitCollectionDidChange:] + 204 20 UIKitCore 0x000000018da0a5cc -[UIViewController _updateTraitsIfNecessary] + 372 21 UIKitCore 0x000000018e503414 -[UIView+ 15606804 (CALayerDelegate) layoutSublayersOfLayer:] + 1048 22 QuartzCore 0x0000000190a96724 -[CALayer layoutSublayers] + 284 23 QuartzCore 0x0000000190a9c87c CA::Layer::layout_if_needed+ 1407100 (CA::Transaction*) + 468 24 QuartzCore 0x0000000190aa73c0 CA::Layer::layout_and_display_if_needed+ 1450944 (CA::Transaction*) + 140 25 QuartzCore 0x00000001909eff1c CA::Context::commit_transaction+ 700188 (CA::Transaction*, double) + 296 26 QuartzCore 0x0000000190a198bc CA::Transaction::commit+ 870588 () + 676 27 UIKitCore 0x000000018e0589f4 __83-[UIApplication _createSnapshotContextForScene:withName:performLayoutWithSettings:]_block_invoke_4 + 44 28 UIKitCore 0x000000018e057dd0 -[UIApplication _performWithUICACommitStateSnapshotting:] + 184 29 UIKitCore 0x000000018e05892c __83-[UIApplication _createSnapshotContextForScene:withName:performLayoutWithSettings:]_block_invoke_2 + 552 30 UIKitCore 0x000000018e4f61cc +[UIView+ 15552972 (Animation) performWithoutAnimation:] + 96 31 UIKitCore 0x000000018e0586cc __83-[UIApplication _createSnapshotContextForScene:withName:performLayoutWithSettings:]_block_invoke + 216 32 UIKitCore 0x000000018d665540 -[UIScene _applyOverrideSettings:forActions:] + 116 33 UIKitCore 0x000000018e294fa4 -[UIWindowScene _applySnapshotSettings:forActions:] + 76 34 UIKitCore 0x000000018e05859c -[UIApplication _createSnapshotContextForScene:withName:performLayoutWithSettings:] + 380 35 UIKitCore 0x000000018e059f38 __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke_3 + 124 36 FrontBoardServices 0x000000018f166538 -[FBSSceneSnapshotAction _executeNextRequest] + 256 37 FrontBoardServices 0x000000018f16658c -[FBSSceneSnapshotAction _executeNextRequest] + 340 38 FrontBoardServices 0x000000018f166128 -[FBSSceneSnapshotAction executeRequestsWithHandler:completionHandler:expirationHandler:] + 276 39 UIKitCore 0x000000018e059e60 __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke_2 + 280 40 UIKitCore 0x000000018e0593c8 -[UIApplication _beginSnapshotSessionForScene:withSnapshotBlock:] + 1028 41 UIKitCore 0x000000018e059d20 __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke + 132 42 UIKitCore 0x000000018d665438 -[UIScene _enableOverrideSettingsForActions:] + 60 43 UIKitCore 0x000000018d6656b8 -[UIScene _performSystemSnapshotWithActions:] + 120 44 UIKitCore 0x000000018e059a9c -[UIApplication _performSnapshotsWithAction:forScene:completion:] + 468 45 UIKitCore 0x000000018e594968 __98-[_UISceneSnapshotBSActionsHandler _respondToActions:forFBSScene:inUIScene:fromTransitionContext:]_block_invoke_3 + 168 46 UIKitCore 0x000000018e5947f0 __98-[_UISceneSnapshotBSActionsHandler _respondToActions:forFBSScene:inUIScene:fromTransitionContext:]_block_invoke_2 + 468 47 UIKitCore 0x000000018d664cb4 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 664 48 UIKitCore 0x000000018d665cac -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 220 49 UIKitCore 0x000000018dbebafc -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 464 50 FrontBoardServices 0x000000018f1200a8 -[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:] + 528 51 FrontBoardServices 0x000000018f144684 __88-[FBSWorkspaceScenesClient sceneID:updateWithSettingsDiff:transitionContext:completion:]_block_invoke_2 + 120 52 FrontBoardServices 0x000000018f129bfc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 232 53 FrontBoardServices 0x000000018f1445b8 __88-[FBSWorkspaceScenesClient sceneID:updateWithSettingsDiff:transitionContext:completion:]_block_invoke + 184 54 libdispatch.dylib 0x0000000189c6e524 _dispatch_client_callout + 16 55 libdispatch.dylib 0x0000000189c17434 _dispatch_block_invoke_direct$VARIANT$mp + 224 56 FrontBoardServices 0x000000018f168850 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40 57 FrontBoardServices 0x000000018f16851c -[FBSSerialQueue _queue_performNextIfPossible] + 404 58 FrontBoardServices 0x000000018f168a44 -[FBSSerialQueue _performNextFromRunLoopSource] + 28 59 CoreFoundation 0x0000000189f26c18 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 60 CoreFoundation 0x0000000189f26b70 __CFRunLoopDoSource0 + 80 61 CoreFoundation 0x0000000189f262f8 __CFRunLoopDoSources0 + 184 62 CoreFoundation 0x0000000189f21328 __CFRunLoopRun + 788 63 CoreFoundation 0x0000000189f20ce8 CFRunLoopRunSpecific + 424 64 GraphicsServices 0x000000019406b38c GSEventRunModal + 160 65 UIKitCore 0x000000018e04f444 UIApplicationMain + 1932 66 RemoteApp.Forms.iOS 0x0000000105a33798 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 344 67 RemoteApp.Forms.iOS 0x000000010516b020 UIKit_UIApplication_Main_string___intptr_intptr + 44970016 (UIApplication.cs:86) 68 RemoteApp.Forms.iOS 0x000000010516aea4 UIKit_UIApplication_Main_string___string_string + 44969636 (UIApplication.cs:66) 69 RemoteApp.Forms.iOS 0x000000010273c190 RemoteApp_Forms_iOS_Application_Main_string__ + 737680 (Main.cs:17) 70 RemoteApp.Forms.iOS 0x0000000103003860 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 272 71 RemoteApp.Forms.iOS 0x0000000107138388 mono_jit_runtime_invoke + 78316424 (mini-runtime.c:3165) 72 RemoteApp.Forms.iOS 0x00000001071e65d4 mono_runtime_invoke_checked + 79029716 (object.c:3220) 73 RemoteApp.Forms.iOS 0x00000001071eb878 mono_runtime_exec_main_checked + 79050872 (object.c:5284) 74 RemoteApp.Forms.iOS 0x000000010711ce74 mono_jit_exec + 78204532 (driver.c:1328) 75 RemoteApp.Forms.iOS 0x00000001072cfd84 xamarin_main + 79986052 (monotouch-main.m:485) 76 RemoteApp.Forms.iOS 0x000000010273c094 main + 737428 (main.m:186) 77 libdyld.dylib 0x0000000189da88f0 start + 4