firebase-ios-sdk: Crash in FIRAAppDelegateProxy application:openURL
[REQUIRED] Step 2: Describe your environment
- Xcode version: 9.3
- Firebase SDK version: Firebase/Core 4.10.1
- Firebase Component: Core
- Component versions:
- FirebaseAnalytics (= 4.1.0)
- FirebaseCore (= 4.0.17)
- FirebaseAnalytics (4.1.0):
- FirebaseCore (~> 4.0)
- FirebaseInstanceID (~> 2.0)
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- nanopb (~> 0.3)
- FirebaseCore (4.0.17):
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- FirebaseInstanceID (2.0.9):
- FirebaseCore (~> 4.0)
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
Crash report received on Bugsnag. I can’t repro the issue.
Relevant Code:
FirebaseApp.configure()
Stacktrace:
0 libswiftCore.dylib swift_getObjectType
1 Recharge application (AppDelegate.swift)
2 Recharge -[FIRAAppDelegateProxy application:openURL:sourceApplication:annotation:] (Recharge)
3 UIKit ___58-[UIApplication _applicationOpenURLAction:payload:origin:]_block_invoke
4 UIKit -[UIApplication _applicationOpenURLAction:payload:origin:]
5 UIKit -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:]
6 UIKit -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:]
7 UIKit ___82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke
8 UIKit -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]
9 UIKit ___125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke
10 UIKit __performActionsWithDelayForTransitionContext
11 UIKit -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]
12 UIKit -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:]
13 UIKit -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:]
14 FrontBoardServices ___80-[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke.362
I do have an implementation of func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) but I don’t see a call to it, which makes me think it’s something in the FIRAAppDelegateProxy that’s blowing up.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 23 (5 by maintainers)
We had the same crashes and it’s related to a bug in swift 4.1 / XCode 9.3 reported here :
https://bugs.swift.org/browse/SR-7240?focusedCommentId=33771&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-33771
Our crashes were reproducible when opening a deep link.
And as @EmDee it was because we had implemented :
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> BoolWe just replaced it with :
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> BoolThat fixed our crashes. Hope it helps others.
We just had a very similar issue at our end. 100% reproducible as well.
Our issue happened due to authentication with the Facebook SDK (so probably similar to @jkmartin19’s issue). When logging in with the Facebook App (note: doesn’t happen when logging in through the Facebook website), the Facebook callback is most likely calling
application(_:open:sourceApplication:annotation:), which then leads to the crash.Our solution was simple: Just don’t implement
application(_:open:sourceApplication:annotation:). It has been deprecated since iOS9 anyway. The Facebook SDK luckily has a replacement callback toapplication(_:open:options:).Here’s our stack trace of the crash:
@deguilardi As mentioned previously this issue is not related to Firebase at all.
You need to replace:
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> BoolBy:
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> BoolIf you need source and annotation you just need to get them from the options dictionary with the following keys UIApplicationOpenURLOptionsKey.sourceApplication and UIApplicationOpenURLOptionsKey. annotation
I had suspected the upgrade from Firebase 4.10.0 to 4.10.1 as the issue, so I downgraded back to 4.10.0, but the issue is still happening. Definitely doesn’t seem like an actual issue with Firebase SDK at this point, I’m just gonna upgrade to 4.12.0 and make a release with the above workaround. @paulb777 feel free to close this if you want? Thanks all!
Please note for those that can’t just remove that delegate call: In @LaurentLK’s link there is a very simple workaround fix, which I’ve seen in other people’s code as well, where you only have to change the
annotationtype fromAnytoAny?.I got same issue.
xcode 9.2 (Swift4.0) is fine for firebaseSDK
xcode 9.3 build is ok, but when i run my app, got crash my podfile. pod ‘Firebase/Core’ pod ‘Firebase/Crash’ pod ‘Firebase/DynamicLinks’
I installed Installing Firebase (4.11.0) Installing FirebaseAnalytics (4.1.0) Installing FirebaseCore (4.0.18) Installing FirebaseCrash (2.0.2) Installing FirebaseDynamicLinks (2.3.2) Installing FirebaseInstanceID (2.0.10)
same relevant code FirebaseApp.configure()
I think firebase sdk not support for xcode9.3(swfit4.1). Same FIRAAppDelegateProxy issue
class AppDelegate: UIResponder, UIApplicationDelegate, UIAlertViewDelegate { this position got Thread1: EXC_BAD_ACCESS(code=1,…) crash.
bug trace