App crashes with [UIApplication _applicationOpenURLAction:payload:origin:]

Since some weeks we have app crashes but I'm unabled to reproduce it. Does someone have an idea how this can happen and where to look?


Code Block
Incident Identifier: 75DB8F4A-50BB-4943-A874-D1560B6DC863
Hardware Model: iPhone11,2
Version: 6.2.62.2 (6.2.62)
AppStoreTools: 12B45a
AppVariant: 1:iPhone11,2:13
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Date/Time: 2020-12-08 21:13:14.5364 +0100
Launch Time: 2020-12-08 21:13:09.6886 +0100
OS Version: iPhone OS 14.2 (18B92)
Release Type: User
Baseband Version: 3.01.01
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x1a7804878 exceptionPreprocess + 220 (NSException.m:199)
1 libobjc.A.dylib 0x1bbd5ac50 objc_exception_throw + 60 (objc-exception.mm:565)
2 CoreFoundation 0x1a770a000 +[NSException raise:format:arguments:] + 100 (NSException.m:146)
3 Foundation 0x1a8a9b91c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 132 (NSException.m:231)
4 UIKitCore 0x1aa1c0720 58-[UIApplication _applicationOpenURLAction:payload:origin:]_block_invoke + 1084 (UIApplication.m:7060)
5 UIKitCore 0x1aa1c00c0 -[UIApplication _applicationOpenURLAction:payload:origin:] + 912 (UIApplication.m:7106)
6 UIKitCore 0x1aa1cd700 -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] + 5048 (UIApplication.m:10163)
7 UIKitCore 0x1a963c614 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 492 (UIScene.m:1118)
8 UIKitCore 0x1a963d7dc -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 248 (UIScene.m:1380)
9 UIKitCore 0x1a9cb1d0c -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 492 (UIApplicationSceneClientAgent.m:80)
10 FrontBoardServices 0x1b6b0dd54 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 484 (FBSScene.m:547)
11 FrontBoardServices 0x1b6b3a5c4 94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 152 (FBSWorkspaceScenesClient.m:533)
12 FrontBoardServices 0x1b6b1c560 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240 (FBSWorkspace.m:355)
13 FrontBoardServices 0x1b6b3a4f0 94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 396 (FBSWorkspaceScenesClient.m:532)
14 libdispatch.dylib 0x1a73f8db0 _dispatch_client_callout + 20 (object.m:559)
15 libdispatch.dylib 0x1a73fc738 _dispatch_block_invoke_direct + 268 (queue.c:468)
16 FrontBoardServices 0x1b6b61310 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 48 (FBSSerialQueue.m:184)
17 FrontBoardServices 0x1b6b60fa0 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 448 (FBSSerialQueue.m:227)
18 FrontBoardServices 0x1b6b614f4 -[FBSSerialQueue _performNextFromRunLoopSource] + 32 (FBSSerialQueue.m:258)
19 CoreFoundation 0x1a778076c CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 (CFRunLoop.c:1967)
20 CoreFoundation 0x1a7780668 CFRunLoopDoSource0 + 208 (CFRunLoop.c:2011)
21 CoreFoundation 0x1a777f960 CFRunLoopDoSources0 + 268 (CFRunLoop.c:2048)
22 CoreFoundation 0x1a7779a8c __CFRunLoopRun + 824 (CFRunLoop.c:2925)
23 CoreFoundation 0x1a777921c CFRunLoopRunSpecific + 600 (CFRunLoop.c:3242)
24 GraphicsServices 0x1be7f8784 GSEventRunModal + 164 (GSEvent.c:2259)
25 UIKitCore 0x1aa1b2200 -[UIApplication _run] + 1072 (UIApplication.m:3266)
26 UIKitCore 0x1aa1b7a74 UIApplicationMain + 168 (UIApplication.m:4738)
28 libdyld.dylib 0x1a74396c0 start + 4

Your app received a request to open a URL, so you should audit your code in that area and test those paths. For example, what happens in your app delegate when it receives a URL, such as through application:openURL:options:?
Thanx for the reply. In our AppDelegate there is no openUrl method implemented. We have some calls like this in some classes
Code Block
UIApplication.shared.openURL(url)

I was wondering if some Objective-C code is involved in this because the stack trace contains squared brackets
Code Block
[UIApplication _applicationOpenURLAction:payload:origin:]

Or is this irrelevant? We are using some libraries written in Objective-C
I figured out where the crashes are coming from: Smart Banner in SFSafariViewController.

When the app presents a SFSafariViewController and the smart banner of the app itself is shown in the html and the user taps on it then the app quits with the stack strack from above.

I'm glad to hear you figured out a reproducible test case.

I was wondering if some Objective-C code is involved in this because the stack trace contains squared brackets 
Code Block
[UIApplication _applicationOpenURLAction:payload:origin:]

Or is this irrelevant? We are using some libraries written in Objective-C

It's relevant only in that the call is in the system UIKit library, which uses Objective-C. You should implement the delegate method I mentioned previously, and then work to understand how to handle the URL you're getting from your reproducible test case.


App crashes with [UIApplication _applicationOpenURLAction:payload:origin:]
 
 
Q