Friend-LGA / LGAlertView

Customizable implementation of UIAlertViewController, UIAlertView and UIActionSheet. All in one. You can customize every detail. Make AlertView of your dream! :)
MIT License
1.07k stars 212 forks source link

Crash on windowVisibleChanged #85

Open rahulvyas opened 1 year ago

rahulvyas commented 1 year ago

I got a crash report on firebase with the below log

LGAlertViewWindowsObserver windowVisibleChanged

Crashed: com.apple.main-thread 0 libsystem_kernel.dylib 0xf2a4 abort_with_payload + 8 1 libsystem_kernel.dylib 0x32c8c abort_with_payload_wrapper_internal + 104 2 libsystem_kernel.dylib 0x32c24 abort_with_payload_wrapper_internal + 30 3 libobjc.A.dylib 0x3ba94 _objc_fatalv(unsigned long long, unsigned long long, char const, char) + 116 4 libobjc.A.dylib 0x3ba20 _objc_fatalv(unsigned long long, unsigned long long, char const, char) + 30 5 libobjc.A.dylib 0x7ca0 weak_register_no_lock + 396 6 libobjc.A.dylib 0xdbf0 objc_initWeak + 440 7 DroneNation 0xad7b0c -[LGAlertViewWindowsObserver windowVisibleChanged:] + 73 (LGAlertViewWindowsObserver.m:73) 8 CoreFoundation 0x41018 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 148 9 CoreFoundation 0xd8724 _CFXRegistrationPost_block_invoke + 88 10 CoreFoundation 0xbcf50 _CFXRegistrationPost + 440 11 CoreFoundation 0x53428 _CFXNotificationPost + 724 12 Foundation 0x5a640 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 13 UIKitCore 0x1f5e0c -[UIWindow _setHidden:forced:] + 708 14 UIKitCore 0x10a391c -[UIAutoRotatingWindow _didRemoveSubview:] + 112 15 UIKitCore 0x885dc UIViewWasRemovedFromSuperview + 148 16 UIKitCore 0x855b0 -[UIView(Hierarchy) removeFromSuperview] + 240 17 UIKitCore 0x2954c0 -[UIWindow _removeAllViewControllersFromWindowHierarchyFromDealloc:] + 412 18 UIKitCore 0x3075f4 -[UIWindow dealloc] + 296 19 UIKitCore 0x66db5c -[UIRemoteInputViewHost .cxx_destruct] + 44 20 libobjc.A.dylib 0x14a4 object_cxxDestructFromClass(objc_object, objc_class) + 116 21 libobjc.A.dylib 0x7120 objc_destructInstance + 80 22 libobjc.A.dylib 0x10fe8 _objc_rootDealloc + 80 23 UIKitCore 0x4ad844 -[UIKeyboardSceneDelegate .cxx_destruct] + 120 24 libobjc.A.dylib 0x14a4 object_cxxDestructFromClass(objc_object, objc_class) + 116 25 libobjc.A.dylib 0x7120 objc_destructInstance + 80 26 libobjc.A.dylib 0x10fe8 _objc_rootDealloc + 80 27 UIKitCore 0x481008 -[UIKeyboardSceneDelegate dealloc] + 288 28 CoreFoundation 0x753f0 -[NSArrayI_Transfer dealloc] + 84 29 libobjc.A.dylib 0x15cc AutoreleasePoolPage::releaseUntil(objc_object**) + 196 30 libobjc.A.dylib 0x5ea4 objc_autoreleasePoolPop + 260 31 FrontBoardServices 0x55c0 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 176 32 FrontBoardServices 0x16fac 84-[FBSWorkspaceScenesClient _queue_invalidateScene:withTransitionContext:completion:]_block_invoke + 292 33 libdispatch.dylib 0x4378 _dispatch_client_callout + 20 34 libdispatch.dylib 0x7dc0 _dispatch_block_invoke_direct + 284 35 FrontBoardServices 0xe230 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 52 36 FrontBoardServices 0x65d68 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240 37 FrontBoardServices 0x65e94 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28 38 CoreFoundation 0xd109c CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 39 CoreFoundation 0xdc59c CFRunLoopDoSource0 + 176 40 CoreFoundation 0x69d7c CFRunLoopDoSources0 + 244 41 CoreFoundation 0x7c114 CFRunLoopRun + 828 42 CoreFoundation 0x80db0 CFRunLoopRunSpecific + 600 43 GraphicsServices 0x1224 GSEventRunModal + 164 44 UIKitCore 0x39164c -[UIApplication _run] + 888 45 UIKitCore 0x3912b0 UIApplicationMain + 340 46 DroneNation 0x44f4f4 main + 14 (main.m:14) 47 ??? 0x1c69df4f8 (Missing)

rahulvyas commented 1 year ago

anyone knows any fix for this? @gKamelo @heroims @Friend-LGA

devstas commented 1 year ago

Until I figured it out. So far, I only see that this happens only on iOS 17 and when the application goes into the background.

rahulvyas commented 1 year ago

Until I figured it out. So far, I only see that this happens only on iOS 17 and when the application goes into the background.

Yeah. Any workaround you found?

rahulvyas commented 1 year ago

Until I figured it out. So far, I only see that this happens only on iOS 17 and when the application goes into the background.

What's happening is when user puts app in recent list to force close the app and as soon as user force closes the app the device is rebooted.

elkateeb88 commented 1 year ago

@rahulvyas , Any solution found?

rahulvyas commented 1 year ago

@rahulvyas , Any solution found?

Not yet :(

JGideon commented 1 year ago

you can remove __weak UIWindow *weakWindow = window; to try to fix this problem.

rahulvyas commented 1 year ago

you can remove __weak UIWindow *weakWindow = window; to try to fix this problem.

Can you create a fork with this fix and include other fix as well. I mean this pull request (https://github.com/Friend-LGA/LGAlertView/pull/84)

rahulvyas commented 1 year ago

@JGideon Have you created a new fork?

rahulvyas commented 11 months ago

__weak UIWindow *weakWindow = window;

What should I put after removing this?

JGideon commented 10 months ago

__weak UIWindow *weakWindow = window;

What should I put after removing this?

Just use window instead of weakWindow.