I have received the below exception backtrace from Apple for an app I had submitted to the app store. I have symbolicated the log but my app's entry has not symbolicated. Any idea what I can do to achieve that? Please see Entry # 14 below which provides more detail. Any help would be much appreciated
Last Exception Backtrace:
0 CoreFoundation 0x1810cadb0 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x18072ff80 objc_exception_throw + 56
2 UIKit 0x186b6d268 -[UIPopoverPresentationController presentationTransitionWillBegin] + 2884
3 UIKit 0x186581fb0 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 1640
4 UIKit 0x1865800c8 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 332
5 UIKit 0x1864d30c8 _runAfterCACommitDeferredBlocks + 292
6 UIKit 0x1864e0a80 _cleanUpAfterCAFlushAndRunDeferredBlocks + 92
7 UIKit 0x1862125a4 _afterCACommitHandler + 96
8 CoreFoundation 0x181080728 _CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
9 CoreFoundation 0x18107e4cc __CFRunLoopDoObservers + 372
10 CoreFoundation 0x18107e8fc __CFRunLoopRun + 928
11 CoreFoundation 0x180fa8c50 CFRunLoopRunSpecific + 384
12 GraphicsServices 0x182890088 GSEventRunModal + 180
13 UIKit 0x18628a088 UIApplicationMain + 204
14 MyApp 0x1000fb144 0x1000e4000 + 94532
15 libdyld.dylib 0x180b468b8 start + 4
Finally solved the problem. I was invoking UIAlertController in my code to present an action sheet with various options. To cater to devices that don't have a camera, I had added a conditional statement to directly present an ImagePicker instead of an action sheet.
iPAD testing was carried out only on the simulator which doesn't have a camera, thus directly invoking the ImagePicker. When he Conditional statement was removed, it tried presenting the Action Sheet through a PopoverPresentationController and crashed - as is evident in statement 2 of the Exception Backtrace.
I subsequently added the following code to fix the oversight:
if let popOver = optionMenu.popoverPresentationController {
popOver.sourceRect = sender.bounds
popOver.sourceView = sender
}
Related
In my iPhone app, for some users the app will always crash, whenever they open a certain window. The same window works fine for me and other people, but always causes a crash for some people. It is unclear at this moment what the difference is between people for whom it fails, and for whom it works fine.
The animation to open the specific view will run fine, but will then cause a crash immediately after the animation is finished.
They have sent me the crashlog, but it is hard to understand what is exactly going wrong. I am hoping you can help me understand. The cause for the failure as given by the crashlog is the following exception:
Last Exception Backtrace:
0 CoreFoundation 0x1836ffd38 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x182c14528 objc_exception_throw + 55
2 CoreFoundation 0x18370d1f8 -[NSObject+ 1372664 (NSObject) doesNotRecognizeSelector:] + 139
3 UIKit 0x18cec7cc4 -[UIResponder doesNotRecognizeSelector:] + 295
4 CoreFoundation 0x1837056e4 ___forwarding___ + 1379
5 CoreFoundation 0x1835eb0dc _CF_forwarding_prep_0 + 91
6 CoreFoundation 0x1835d6be8 CFStringAppend + 519
7 CoreFoundation 0x1836bddf0 __CFStringAppendFormatCore + 9271
8 CoreFoundation 0x1836bf658 _CFStringCreateWithFormatAndArgumentsAux2 + 131
9 AccessibilityUtilities 0x192d6b388 _AXStringForArgs + 279
10 UIKit 0x1a242adf8 -[UIViewControllerAccessibility viewDidAppear:] + 267
11 UIKit 0x18cb2869c -[UIViewController _setViewAppearState:isAnimating:] + 851
12 UIKit 0x18cb28c08 -[UIViewController _endAppearanceTransition:] + 227
13 UIKit 0x18cbcee00 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 1327
14 UIKit 0x1a2440cd4 -[UINavigationControllerAccessibility navigationTransitionView:didEndTransition:fromView:toView:] + 111
15 UIKit 0x18cc96bbc __49-[UINavigationController _startCustomTransition:]_block_invoke + 251
16 UIKit 0x18cc229d8 -[_UIViewControllerTransitionContext completeTransition:] + 115
17 UIKit 0x18cd67d30 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke.124 + 751
18 UIKit 0x18cb47d7c -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 763
19 UIKit 0x18cb4770c -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 311
20 UIKit 0x18cb47418 -[UIViewAnimationState animationDidStop:finished:] + 295
21 UIKit 0x1a2468970 -[UIViewAnimationStateAccessibility animationDidStop:finished:] + 131
22 QuartzCore 0x1876ebd6c CA::Layer::run_animation_callbacks+ 1232236 (void*) + 283
23 libdispatch.dylib 0x183085048 _dispatch_client_callout + 15
24 libdispatch.dylib 0x183091b74 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1015
25 CoreFoundation 0x1836a7f20 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 11
26 CoreFoundation 0x1836a5afc __CFRunLoopRun + 2011
27 CoreFoundation 0x1835c62d8 CFRunLoopRunSpecific + 435
28 GraphicsServices 0x185457f84 GSEventRunModal + 99
29 UIKit 0x18cb73880 UIApplicationMain + 207
30 Flyskyhy 0x10490bd80 main + 32128 (main.m:17)
31 libdyld.dylib 0x1830ea56c start + 3
The crashlog seems to indicate that it goes wrong while doing a CFStringAppend, but it is not clear which string is the problem, or what is wrong with it, or even why a CFStringAppend is needed. All strings visible in the view have been filled in already before the animation starts, and they all are correct.
EDIT:
As requested, here is the code that starts the view. Everything is under a NavigationController, so the new view controller is pushed on the navigation stack to open it.
WaypointEditController *controller = [[WaypointEditController alloc] initWithNibName:#"WayPointEdit" bundle:nil];
controller.navigationItem.title = #"New Waypoint";
// initialisation of other, custom, fields of controller
[self.navigationController pushViewController:controller animated:YES];
The WaypointEditController class that is pushed is derived from UIViewController. The viewWillAppear is overridden, to do initialisation of the fields of the view. But - relevant here - viewDidAppear is not overridden.
In case relevant, here are the most important actions in the viewWillAppear method:
- (void) viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
self.navigationItem.title = #"New Waypoint";
// other initialisation of internal fields
}
Like you, I have customers reporting this problem and I could see the stack traces that XCode downloaded from production but I could not reproduce it... until I tried enabling "voice over".
The other accessibility options that I tried worked OK.
The stack trace shows that iOS is sending a selector of "length" to an instance of UILabel. This seemed odd. To see what would happen, I added a "length" method to UILabel to return the length of the UILabel's text property. Then it just failed with an unknown selector of _encodingCantBeStoredInEightBitCFString. So clearly iOS thought that my UILabel was something that it wasn't.
This ended up being because "description" was used for the name of my UILabel property/IBOutlet.
To fix the problem I renamed the property from "description" to something different. I suspect that my synthesized "description" getter was overriding NSObject's description method (which returns an NSString which fits the selectors which were being sent to my UILabel).
When using HTML select element, UIWebView presents a native UIPopoverController as dropdown list on iPad (iPhone uses UIPickerView which works fine).
On iOS11 this appears to be completely broken:
Clicking outside dropdown to dismiss without selecting an option results in popover being closed and immediately re-presented, occasionally empty
When more than one drop down on the page, drop down for new list contains elements from previous list
When selecting second drop down, first one re-opens
Occassionally drop down appears in top left corner (presumably lost it's source view)
Above steps very occasionally result in the following crash:
2017-09-23 09:43:13.190728+0100 Web[1779:86622] * Terminating app
due to uncaught exception 'NSInternalInconsistencyException', reason:
'UITableView dataSource is not set'
* First throw call stack: ( 0 CoreFoundation 0x000000010d4a01cb exceptionPreprocess + 171 1 libobjc.A.dylib
0x000000010c8bbf41 objc_exception_throw + 48 2 CoreFoundation
0x000000010d4a5362 +[NSException raise:format:arguments:] + 98 3
Foundation 0x000000010c360089
-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193 4
UIKit 0x000000010da742f5 -[UITableView
_createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1756 5 UIKit 0x000000010da7451a -[UITableView
_createPreparedCellForRowAtIndexPath:willDisplay:] + 81 6 UIKit 0x000000010da82137 -[UITableView _heightForRowAtIndexPath:] + 208 7
UIKit 0x000000010dd2b939
-[UISectionRowData heightForRow:inSection:canGuess:] + 259 8 UIKit 0x000000010dd31c1a -[UITableViewRowData
heightForRow:inSection:canGuess:adjustForReorderedRow:] + 277 9
UIKit 0x000000010dd36230
-[UITableViewRowData ensureHeightsFaultedInForScrollToIndexPath:withScrollPosition:boundsHeight:]
+ 964 10 UIKit 0x000000010da51110 -[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:usingPresentationValues:]
+ 2783 11 UIKit 0x000000010da51b8f -[UITableView _scrollToRowAtIndexPath:atScrollPosition:animated:usingPresentationValues:]
+ 146 12 UIKit 0x000000010da51a11 -[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] + 123 13 UIKit 0x000000010de72d11
-[UIWebSelectTableViewController viewWillAppear:] + 247 14 UIKit 0x000000010dabe9b0 -[UIViewController
_setViewAppearState:isAnimating:] + 444 15 UIKit 0x000000010dabf245 -[UIViewController __viewWillAppear:] + 147 16
UIKit 0x000000010da8b881
__56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 1088 17 UIKit
0x000000010d926c61 _runAfterCACommitDeferredBlocks + 318 18 UIKit
0x000000010d91530d _cleanUpAfterCAFlushAndRunDeferredBlocks + 280 19
UIKit 0x000000010d945600
_afterCACommitHandler + 137 20 CoreFoundation 0x000000010d442db7
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 21 CoreFoundation 0x000000010d442d0e
__CFRunLoopDoObservers + 430 22 CoreFoundation 0x000000010d427324 __CFRunLoopRun + 1572 23 CoreFoundation
0x000000010d426a89 CFRunLoopRunSpecific + 409 24 GraphicsServices
0x00000001124c89c6 GSEventRunModal + 62 25 UIKit
0x000000010d91ad30 UIApplicationMain + 159 26 Web
0x000000010bfb014f main + 111 27 libdyld.dylib
0x0000000110df1d81 start + 1 28 ???
0x0000000000000001 0x0 + 1`
I created a sample application with one line of code which demonstrates the issue:
https://github.com/AshRobinson/BrokenUIWebView
http://gph.is/2xmHFWs
Does anyone have a workaround for such issue? Migrating to WKWebview is not an option for us at this stage.
Is there any way to force iPad to use UIPickerView for dropdowns as per iPhone temporarily?
I have investigated suggestions in other stack overflow posts with no luck, for example:
ios 11 Beta 5 select drop-down list issue
We ran into the same bug. Apple's documentation says that any app iOS 8+ should be using WKWebView. Once we switched to WKWebView, we are no longer seeing this issue.
I ran into this issue, with a WKWebView that was being added into an UIWindow directly. My problem was that the view didn't have an UIViewcontroller linked to it, so the following lines did the trick:
containerVC = [[UIViewController alloc] init];
[containerVC.view addSubview:myWkWebview];
[window addSubview:containerVC.view];
Instead of adding myWkWebview directly to the window. With this, modal views were added again :-)
I have weird crash related to UIButton class. I have not found anything similar on SO yet. The log I get comes from Crashlytics so I also don't know which part of code is causing the issue. I put crash log below, may be some of you have already found out what is creating the problem.
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xd1712d18
0 libobjc.A.dylib objc_msgSend + 5 _setTitleFrozen:
1 UIKit 32-[UIButton _beginTitleAnimation]_block_invoke853 + 28
2 UIKit -[UIViewAnimationBlockDelegate_didEndBlockAnimation:finished:context:] + 308
3 UIKit -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 184
4 UIKit -[UIViewAnimationState animationDidStop:finished:] + 70
5 QuartzCore CA::Layer::run_animation_callbacks(void*) + 234
6 libdispatch.dylib _dispatch_client_callout + 22
7 libdispatch.dylib _dispatch_main_queue_callback_4CF$VARIANT$mp + 712
8 CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE_ + 8
9 CoreFoundation __CFRunLoopRun + 1512
10 CoreFoundation CFRunLoopRunSpecific + 476
11 CoreFoundation CFRunLoopRunInMode + 106
12 GraphicsServices GSEventRunModal + 136
13 UIKit UIApplicationMain + 1440
Changing the button type from System to Custom resolved this crash for me.
In my case this crash occurred because I was changing the button title right before removing it from the view hierarchy (by dismissing its parent view's VC) while the title change animation was still running.
I tried to search about createPeripheral and i had no luck finding any information about it. Is there anyone here who had the same crash as this?
[UIThreadSafeNode createPeripheral]: unrecognized selector sent to instance
Which class does createPeripheral belong to?
How do you handle this crash?
note: there's not much information in the crash log
stackTrace =
(
0 CoreFoundation 0x31dcd2bb <redacted> + 186
1 libobjc.A.dylib 0x39a7297f objc_exception_throw + 30
2 CoreFoundation 0x31dd0e07 <redacted> + 170
3 CoreFoundation 0x31dcf531 <redacted> + 392
4 CoreFoundation 0x31d26f68 _CF_forwarding_prep_0 + 24
5 UIKit 0x33d4bf99 <redacted> + 52
6 UIKit 0x33bda80f <redacted> + 38
7 UIKit 0x33bda431 <redacted> + 404
8 UIKit 0x33f1ad19 <redacted> + 236
9 libdispatch.dylib 0x39e98621 <redacted> + 80
9 libdispatch.dylib 0x39e98621 <redacted> + 80
10 libdispatch.dylib 0x39e894b7 <redacted> + 22
11 libdispatch.dylib 0x39e8adcb <redacted> + 226
12 CoreFoundation 0x31da0f3b <redacted> + 1290
13 CoreFoundation 0x31d13ebd CFRunLoopRunSpecific + 356
14 CoreFoundation 0x31d13d49 CFRunLoopRunInMode + 104
15 GraphicsServices 0x358d72eb GSEventRunModal + 74
16 UIKit 0x33c29301 UIApplicationMain + 1120
...
);
Apologies for adding to an old post, but I do have a strong reproduction case for this bug. Open any software keyboard on the iPhone6+ (or iPhone6+ simulator) in a WebView. Put something in the paste-buffer, then click the paste button.
I haven't solved it yet, but I thought this might help if anyone is lost in google for this bug.
I've just got a similar crash report.
There is UIWebBrowserView in the call stack. Maybe it is a bug in it.
Our application uses UIWebView to show a simple html page, and I receive random crashes in WebView regulary. I have no idea what to do with it.
In my case this error occured when I tried to customize -inputaccessoryview on contenteditable div.
I believe createPeripheral has something to deal with Keyboard display as
webView.keyboardDisplayRequiresUserAction = NO;
solved this crash for me.
I am trying to display a view that contains details of the user's account. Being fairly new to iOS development, the following code is what should work (based the docs and searches). Yet, the application crashes and I get a an error stating unrecognized selector:
2012-03-13 16:32:25.616 UrbanAgendaApp[4993:207] Displaying profile view
2012-03-13 16:32:25.635 UrbanAgendaApp[4993:207] -[UAFirstViewController presentViewController:animated:completion:]: unrecognized selector sent to instance 0x4b45240
2012-03-13 16:32:25.674 UrbanAgendaApp[4993:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UAFirstViewController presentViewController:animated:completion:]: unrecognized selector sent to instance 0x4b45240'
*** Call stack at first throw:
(
0 CoreFoundation 0x00fbabe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0110f5c2 objc_exception_throw + 47
2 CoreFoundation 0x00fbc6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00f2c366 ___forwarding___ + 966
4 CoreFoundation 0x00f2bf22 _CF_forwarding_prep_0 + 50
5 UrbanAgendaApp 0x00002308 -[UAFirstViewController showProfileView] + 168
6 UrbanAgendaApp 0x00002254 -[UAFirstViewController myUaBtnTouch:] + 52
7 UIKit 0x00014a6e -[UIApplication sendAction:to:from:forEvent:] + 119
8 UIKit 0x000a31b5 -[UIControl sendAction:to:forEvent:] + 67
9 UIKit 0x000a5647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
10 UIKit 0x000a41f4 -[UIControl touchesEnded:withEvent:] + 458
11 UIKit 0x000390d1 -[UIWindow _sendTouchesForEvent:] + 567
12 UIKit 0x0001a37a -[UIApplication sendEvent:] + 447
13 UIKit 0x0001f732 _UIApplicationHandleEvent + 7576
14 GraphicsServices 0x00cbea36 PurpleEventCallback + 1550
15 CoreFoundation 0x00f9c064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x00efc6f7 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x00ef9983 __CFRunLoopRun + 979
18 CoreFoundation 0x00ef9240 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x00ef9161 CFRunLoopRunInMode + 97
20 GraphicsServices 0x00cbd268 GSEventRunModal + 217
21 GraphicsServices 0x00cbd32d GSEventRun + 115
22 UIKit 0x0002342e UIApplicationMain + 1160
23 UrbanAgendaApp 0x00001c2a main + 170
24 UrbanAgendaApp 0x00001b75 start + 53
25 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
The method where this occurs is in a method in FirstViewController, which gets called as a result of a touch up event inside a button:
-(void)showProfileView {
NSLog( #"%#", #"Displaying profile view" ); // ***
UAProfileView *profileView = [[UAProfileView alloc] init];
[self presentViewController:profileView animated:TRUE completion:0];
}
This UAProfielView is a subclass of UIViewController and was was created along with an appropriate .xib file.
So the question is, how do I display this new view in my iPhone application? Using a storyboard is not an option because I have to support iOS 4.0.
The documentation for presentViewController:animated:completion: states that it is only supported on iOS 5.0 and up. You mentioned support for iOS 4.0.
Try presentModalViewController:animated: instead. Alternatively, use a nagivationController and do pushViewController:animated:
#Mike, make sure you connected the nib to the file's owner.
Presumably, the base class of UAFirstViewController is also UIViewController? Are you getting any warnings when you build?
I would personally use completion:nil, but I don't think that will make a difference.
So, if you are getting no warnings, then turn zombies on and see if you are dealing with a dead object. Instructions are here
How to enable NSZombie in Xcode?
Run the program and see if you get a zombie warning in the console. If that's the case, then the memory management is wrong.
If all of that is ok, post the code where you call showProfileView.