I am getting random crashes with an UIAlertView. The crash does not always happen, and it is very random. Any help is appreciated.
Here is the stack trace :
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x398685b0 objc_msgSend + 16
1 UIKit 0x33b59c4c -[UIAlertView(Private) _buttonClicked:]
2 UIKit 0x33aed0c0 -[UIApplication sendAction:to:from:forEvent:]
3 UIKit 0x33aed072 -[UIApplication sendAction:toTarget:fromSender:forEvent:]
4 UIKit 0x33aed050 -[UIControl sendAction:to:forEvent:]
5 UIKit 0x33aec906 -[UIControl(Internal) _sendActionsForEvents:withEvent:]
6 UIKit 0x33aecdfc -[UIControl touchesEnded:withEvent:]
7 UIKit 0x33a155ec -[UIWindow _sendTouchesForEvent:]
8 UIKit 0x33a027fc -[UIApplication sendEvent:]
9 UIKit 0x33a02116 _UIApplicationHandleEvent
10 GraphicsServices 0x356f25a0 _PurpleEventCallback
11 GraphicsServices 0x356f21ce PurpleEventCallback
12 CoreFoundation 0x31bcf170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
13 CoreFoundation 0x31bcf112 __CFRunLoopDoSource1
14 CoreFoundation 0x31bcdf94 __CFRunLoopRun
15 CoreFoundation 0x31b40eb8 CFRunLoopRunSpecific
16 CoreFoundation 0x31b40d44 CFRunLoopRunInMode
17 GraphicsServices 0x356f12e6 GSEventRunModal
18 UIKit 0x33a562fc UIApplicationMain
Your delegate is probably being cleaned up before the button press. This can happen (for example) if the view or that launched the alert is no longer on screen. Try turning on Zombie Objects (under Edit Scheme -> Run -> Diagnostics). If a deallocated object is sent a message, you'll get a message in the debug console.
Related
According to crashlytics, a few users are experiencing crashes on the following line
-[UITextView(LinkInteraction) startInteractionWithLinkAtPoint:]
I can't replicate it at all. This might be an iOS 11 issue because that seems to be version it is crashing on.
Here is the complete crash log.
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x1849fed8c __exceptionPreprocess
1 libobjc.A.dylib 0x183bb85ec objc_exception_throw
2 CoreFoundation 0x1849febf8 +[NSException raise:format:]
3 Foundation 0x1853eefa0 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4 UIKit 0x18f2daf3c -[UITextView(LinkInteraction) startInteractionWithLinkAtPoint:]
5 UIKit 0x18ed4597c -[UITextGestureClusterLinkInteract smallDelayRecognizer:]
6 UIKit 0x18e7ea6e8 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:]
7 UIKit 0x18ed573b4 _UIGestureRecognizerSendTargetActions
8 UIKit 0x18e94ce38 _UIGestureRecognizerSendActions
9 UIKit 0x18e7e9720 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:]
10 UIKit 0x18ed48bd4 _UIGestureEnvironmentUpdate
11 UIKit 0x18e7e34d8 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:]
12 UIKit 0x18e7e3010 -[UIGestureEnvironment _updateGesturesForEvent:window:]
13 UIKit 0x18e7e2874 -[UIWindow sendEvent:]
14 UIKit 0x18e7e11d0 -[UIApplication sendEvent:]
15 UIKit 0x18efc2d1c __dispatchPreprocessedEventFromEventQueue
16 UIKit 0x18efc52c8 __handleEventQueueInternal
17 UIKit 0x18efbe368 __handleHIDEventFetcherDrain
18 CoreFoundation 0x1849a7404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
19 CoreFoundation 0x1849a6c2c __CFRunLoopDoSources0
20 CoreFoundation 0x1849a479c __CFRunLoopRun
21 CoreFoundation 0x1848c4da8 CFRunLoopRunSpecific
22 GraphicsServices 0x1868a9020 GSEventRunModal
23 UIKit 0x18e8e1758 UIApplicationMain
24 MyApp 0x10441cc88 main (main.m:14)
25 libdyld.dylib 0x184355fc0 start
I've seen this stackoverflow post
UITextView startInteractionWithLinkAtPoint crash iOS 11 only
However, I don't want to disable drag and drop. Should I wait until Apple fixes this issue because this seems to be a bug on Apple's end.
UIImagePickerController crash on image capture.
Refer to logs captured by crashlytics:
*** setObjectForKey: object cannot be nil (key: UIImagePickerControllerOriginalImage)
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x182ec81c0 __exceptionPreprocess
1 libobjc.A.dylib 0x18190055c objc_exception_throw
2 CoreFoundation 0x182da979c -[__NSCFNumber hash]
3 PhotoLibrary 0x18f9e5974 __CreateInfoForImage
4 PhotoLibrary 0x18f9e564c PLNotifyImagePickerOfImageAvailability
5 CameraUI 0x198443d14 -[CAMImagePickerCameraViewController _handleCapturedImagePickerPhotoWithCropOverlayOutput:]
6 CameraUI 0x198443628 -[CAMImagePickerCameraViewController cropOverlayWasOKed:]
7 UIKit 0x188d467b0 -[UIApplication sendAction:to:from:forEvent:]
8 UIKit 0x188d46730 -[UIControl sendAction:to:forEvent:]
9 UIKit 0x188d30be4 -[UIControl _sendActionsForEvents:withEvent:]
10 UIKit 0x188d4601c -[UIControl touchesEnded:withEvent:]
11 UIKit 0x188d45b44 -[UIWindow _sendTouchesForEvent:]
12 UIKit 0x188d40d8c -[UIWindow sendEvent:]
13 UIKit 0x188d11858 -[UIApplication sendEvent:]
14 UIKit 0x1894fecb8 __dispatchPreprocessedEventFromEventQueue
15 UIKit 0x1894f8720 __handleEventQueue
16 CoreFoundation 0x182e76278 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
17 CoreFoundation 0x182e75bc0 __CFRunLoopDoSources0
18 CoreFoundation 0x182e737c0 __CFRunLoopRun
19 CoreFoundation 0x182da2048 CFRunLoopRunSpecific
20 GraphicsServices 0x184825198 GSEventRunModal
21 UIKit 0x188d7c628 -[UIApplication _run]
22 UIKit 0x188d77360 UIApplicationMain
23 newbe 0x1002a2a60 main (AppDelegate.swift:22)
24 libdispatch.dylib 0x181d845b8 (Missing)
My app keeps being rejected by Apple Beta Review Team because of what they claim is a crash at boot. Point is the crash never happens on any simulator or device on my side.
The symbolicated crash log reports something like the following, but the line 74 reported in HomeViewController.swift (here I report an image of the code submitted to the Beta Review Team)
is simply referencing a UITableView IBOutlet coming from the storyboard, if I put a breakpoint here the tableView is instantiated. I am using swift, iOS 9.3.2 and Xcode 7.3.1.
EDIT: Line 87 is same, calling a function renderButton(btnOpened, selected: true) on a UIButton IBOutlet.
I tried setting zombies, address sanitizer, I keep not having the crash, they keep having it, I have no clue what possibly could fix this. Does anyone has any idea of what could be wrong?
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 Sportito 0x00000001000cee40 HomeViewController.viewDidLoad() -> () (HomeViewController.swift:74)
1 Sportito 0x00000001000ce990 HomeViewController.viewDidLoad() -> () (HomeViewController.swift:87)
2 Sportito 0x00000001000cee60 #objc HomeViewController.viewDidLoad() -> () (HomeViewController.swift:0)
3 UIKit 0x0000000186934c40 -[UIViewController loadViewIfRequired] + 996
4 UIKit 0x0000000186934844 -[UIViewController view] + 28
5 UIKit 0x0000000186cdaaec -[UINavigationController preferredContentSize] + 172
6 UIKit 0x0000000186b9adf4 -[UIViewController(UIPopoverController_Internal) _resolvedPreferredContentSize] + 68
7 UIKit 0x0000000186b9a858 -[UIPopoverController _transitionFromViewController:toViewController:animated:] + 152
8 UIKit 0x0000000186b9a48c -[UIPopoverController _initWithContentViewController:popoverControllerStyle:] + 836
9 UIKit 0x0000000186f5ac7c -[UISplitViewController _setupHiddenPopoverControllerWithViewController:] + 120
10 UIKit 0x0000000186f5aeec -[UISplitViewController _viewControllerHiding:] + 356
11 UIKit 0x0000000186f62b60 -[UISplitViewController viewWillAppear:] + 208
12 UIKit 0x000000018694d374 -[UIViewController _setViewAppearState:isAnimating:] + 628
13 UIKit 0x000000018694d0e8 -[UIViewController __viewWillAppear:] + 156
14 UIKit 0x000000018693cf14 -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 596
15 UIKit 0x000000018693c13c -[UIView(Internal) _addSubview:positioned:relativeTo:] + 444
16 UIKit 0x000000018693b7e8 -[UIWindow addRootViewControllerViewIfPossible] + 664
17 UIKit 0x0000000186938a88 -[UIWindow _setHidden:forced:] + 252
18 UIKit 0x00000001869aefa4 -[UIWindow makeKeyAndVisible] + 48
19 UIKit 0x0000000186bda3ac -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3456
20 UIKit 0x0000000186bde5f0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1684
21 UIKit 0x0000000186bdb764 -[UIApplication workspaceDidEndTransaction:] + 168
22 FrontBoardServices 0x000000018317f7ac __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36
23 FrontBoardServices 0x000000018317f618 -[FBSSerialQueue _performNext] + 168
24 FrontBoardServices 0x000000018317f9c8 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
25 CoreFoundation 0x000000018179509c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
26 CoreFoundation 0x0000000181794b30 __CFRunLoopDoSources0 + 540
27 CoreFoundation 0x0000000181792830 __CFRunLoopRun + 724
28 CoreFoundation 0x00000001816bcc50 CFRunLoopRunSpecific + 384
29 UIKit 0x00000001869a394c -[UIApplication _run] + 460
30 UIKit 0x000000018699e088 UIApplicationMain + 204
31 Sportito 0x000000010002e860 main (AppDelegate.swift:42)
32 libdyld.dylib 0x000000018125a8b8 start + 4
Is the app set as universal? Could they be getting the crash on an iPad while you're testing on an iPhone, or vice-versa?
According to apple's guideline your app must not crash on iphone or ipad whether your app is universal or not.
If your app is iPhone only then it should run in small resolution on ipad but it must not crash in any situation, because from appstore user can download iphone only app from ipad also so, it shouldn't crash.
So, check in iPad also that your app is not crashing.
If your app is universal then there shouldn't problem of resolution in ipad or iphone both.
So, make sure which mistake you are doing.
hope this will help :)
Could you help me with this mysterious crash? It happens when I re-open the app after a few days, so it's practically impossible to debug it :/
Any clue or idea would be super helpful. I'm kinda lost here. Thank you!
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x0000000196a63bd0 objc_msgSend + 16
1 UIKit 0x000000018ab35418 -[UIApplication sendAction:to:from:forEvent:] + 96
2 UIKit 0x000000018ab1e52c -[UIControl _sendActionsForEvents:withEvent:] + 612
3 UIKit 0x000000018ab34db4 -[UIControl touchesEnded:withEvent:] + 592
4 UIKit 0x000000018ab34a40 -[UIWindow _sendTouchesForEvent:] + 700
5 UIKit 0x000000018ab2df94 -[UIWindow sendEvent:] + 684
6 UIKit 0x000000018ab0168c -[UIApplication sendEvent:] + 264
7 UIKit 0x000000018ada060c _UIApplicationHandleEventFromQueueEvent + 14992
8 UIKit 0x000000018aaffbf4 _UIApplicationHandleEventQueue + 1616
9 CoreFoundation 0x000000018630a9ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
10 CoreFoundation 0x0000000186309c90 __CFRunLoopDoSources0 + 264
11 CoreFoundation 0x0000000186307d40 __CFRunLoopRun + 712
12 CoreFoundation 0x00000001862350a4 CFRunLoopRunSpecific + 396
13 GraphicsServices 0x000000018f3d75a4 GSEventRunModal + 168
14 UIKit 0x000000018ab66aa4 UIApplicationMain + 1488
15 Wiretap 0x000000010012b604 main (main.m:16)
16 libdyld.dylib 0x00000001970bea08 start + 4
I ran into a very unusual problem.. i got a crash on UIKit.. first time i have faced something like this.. Please can anybody guide my in this..
This is the crash log that i got.
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x1161a18c
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x386fcb66 objc_msgSend + 5
1 UIKit 0x30b5dda3 -[UIApplication sendAction:to:from:forEvent:] + 90
2 UIKit 0x30cc5615 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 120
3 UIKit 0x30b5dda3 -[UIApplication sendAction:to:from:forEvent:] + 90
4 UIKit 0x30b5dd3f -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 38
5 UIKit 0x30b5dd13 -[UIControl sendAction:to:forEvent:] + 46
6 UIKit 0x30b49743 -[UIControl _sendActionsForEvents:withEvent:] + 374
7 UIKit 0x30b5d75b -[UIControl touchesEnded:withEvent:] + 594
8 UIKit 0x30b5d425 -[UIWindow _sendTouchesForEvent:] + 528
9 UIKit 0x30b58451 -[UIWindow sendEvent:] + 832
10 UIKit 0x30b2dd79 -[UIApplication sendEvent:] + 196
11 UIKit 0x30b2c569 _UIApplicationHandleEventQueue + 7116
12 CoreFoundation 0x2e36ff1f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
13 CoreFoundation 0x2e36f3e7 __CFRunLoopDoSources0 + 206
14 CoreFoundation 0x2e36dbd7 __CFRunLoopRun + 630
15 CoreFoundation 0x2e2d8471 CFRunLoopRunSpecific + 524
16 CoreFoundation 0x2e2d8253 CFRunLoopRunInMode + 106
17 GraphicsServices 0x330122eb GSEventRunModal + 138
18 UIKit 0x30b8d845 UIApplicationMain + 1136
19 TradeMate 0x0008f2bf main (main.m:16)
You are crashing in objc_msgSend. This means (as explained in this famous article) that the receiver has gone missing. In this case it appears that the user has tapped a button which sends an action message to a target, but the target object has gone out of existence.
Make sure the receiver or the object which receives the events is declared strong.
You may not even get the crash log to figure out what what went wrong :)
If you are getting something like above check if the object is declared strong. That should solve the issue