Updating to 5.1.2 breaks phone and Google auth
Objective C or Swift: Swift iOS version: 11.4 Firebase SDK version: FirebaseCore 5.0.5 FirebaseUI version: 5.1.2 CocoaPods Version: 1.5.2
Step 3: Describe the problem:
Logging in using FirebaseUI with Google stalls on loading after selecting email without useful console messages. Tapping on Phone from the auth picker screen results in . Downgrading to 5.0.0 resolves both issues.
Steps to reproduce:
-
Tap Sign in with Google
-
Tap Continue
-
Select account
-
Observe stall via progress circle that never ends (although login and upgrade does seem to complete as observed in Firebase Console)
-
Tap Sign in with phone
-
Observe crash
Observed Results:
When logging in with Google, no useful errors, just stalled loading.
When trying to log in with Phone, results in this crash:

Expected Results:
- Successful login with either Google or Phone auth
Relevant Code:
let authUI = FUIAuth.defaultAuthUI()
// You need to adopt a FUIAuthDelegate protocol to receive callback
authUI?.delegate = self
let providers: [FUIAuthProvider] = [
FUIGoogleAuth(),
FUIPhoneAuth(authUI:FUIAuth.defaultAuthUI()!),
]
authUI?.providers = providers
authUI?.shouldAutoUpgradeAnonymousUsers = true
let authViewController = authUI?.authViewController()
present(authViewController!, animated: true, completion: nil)
Can you provide the full stack trace of the crash?
I'm able to log in successfully using Google auth in the swift sample app in this repository.
For phone auth:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xda9bf7c08)
frame #0: 0x00000001835bc910 libobjc.A.dylib`objc_msgSend + 16
frame #1: 0x0000000184e37ddc Foundation`_NSDescriptionWithStringProxyFunc + 64
frame #2: 0x00000001843acc70 CoreFoundation`__CFStringAppendFormatCore + 8832
frame #3: 0x00000001843ae740 CoreFoundation`_CFStringCreateWithFormatAndArgumentsAux2 + 132
frame #4: 0x0000000184d28b88 Foundation`+[NSString stringWithFormat:] + 68
* frame #5: 0x0000000102c58178 SAT Prep`-[FUIPrivacyAndTermsOfServiceView(self=0x0000000108824200, _cmd="fullPrivacyPolicyAndTOSMessageWithSMSRateInfo") fullPrivacyPolicyAndTOSMessageWithSMSRateInfo] at FUIPrivacyAndTermsOfServiceView+PhoneAuth.m:36
frame #6: 0x0000000102c58084 SAT Prep`-[FUIPrivacyAndTermsOfServiceView(self=0x0000000108824200, _cmd="useFullMessageWithSMSRateTerm") useFullMessageWithSMSRateTerm] at FUIPrivacyAndTermsOfServiceView+PhoneAuth.m:28
frame #7: 0x0000000102c510ec SAT Prep`-[FUIPhoneEntryViewController viewDidLoad](self=0x0000000109415d60, _cmd="viewDidLoad") at FUIPhoneEntryViewController.m:136
frame #8: 0x000000018e006e64 UIKit`-[UIViewController loadViewIfRequired] + 1020
frame #9: 0x000000018e006a50 UIKit`-[UIViewController view] + 28
frame #10: 0x0000000102c3655c SAT Prep`-[FUIAuthBaseViewController initWithNibName:bundle:authUI:](self=0x0000000109415d60, _cmd="initWithNibName:bundle:authUI:", nibNameOrNil=@"FUIPhoneEntryViewController", nibBundleOrNil=@"/var/containers/Bundle/Application/206C4E84-BF7C-474B-A104-56E5FEB8D17E/SAT Prep.app/FirebasePhoneAuthUI.bundle", authUI=0x00000001c8079440) at FUIAuthBaseViewController.m:80
frame #11: 0x0000000102c50bac SAT Prep`-[FUIPhoneEntryViewController initWithNibName:bundle:authUI:phoneNumber:](self=0x0000000000000000, _cmd="initWithNibName:bundle:authUI:phoneNumber:", nibNameOrNil=@"FUIPhoneEntryViewController", nibBundleOrNil=@"/var/containers/Bundle/Application/206C4E84-BF7C-474B-A104-56E5FEB8D17E/SAT Prep.app/FirebasePhoneAuthUI.bundle", authUI=0x00000001c8079440, phoneNumber=0x0000000000000000) at FUIPhoneEntryViewController.m:106
frame #12: 0x0000000102c50a64 SAT Prep`-[FUIPhoneEntryViewController initWithAuthUI:phoneNumber:](self=0x0000000000000000, _cmd="initWithAuthUI:phoneNumber:", authUI=0x00000001c8079440, phoneNumber=0x0000000000000000) at FUIPhoneEntryViewController.m:95
frame #13: 0x0000000102c4faf4 SAT Prep`-[FUIPhoneAuth signInWithDefaultValue:presentingViewController:completion:](self=0x00000001c802ee00, _cmd="signInWithDefaultValue:presentingViewController:completion:", defaultValue=0x0000000000000000, presentingViewController=0x000000010940d740, completion=0x0000000102c2f6a8) at FUIPhoneAuth.m:126
frame #14: 0x0000000102c2f62c SAT Prep`-[FUIAuth signInWithProviderUI:presentingViewController:defaultValue:](self=0x00000001c8079440, _cmd="signInWithProviderUI:presentingViewController:defaultValue:", providerUI=0x00000001c802ee00, presentingViewController=0x000000010940d740, defaultValue=0x0000000000000000) at FUIAuth.m:185
frame #15: 0x0000000102c3a4ec SAT Prep`-[FUIAuthPickerViewController didTapSignInButton:](self=0x000000010940d740, _cmd="didTapSignInButton:", button=0x0000000109410fd0) at FUIAuthPickerViewController.m:168
frame #16: 0x000000018e15a64c UIKit`-[UIApplication sendAction:to:from:forEvent:] + 96
frame #17: 0x000000018e27b870 UIKit`-[UIControl sendAction:to:forEvent:] + 80
frame #18: 0x000000018e160700 UIKit`-[UIControl _sendActionsForEvents:withEvent:] + 440
frame #19: 0x000000018e2961a8 UIKit`-[UIControl touchesEnded:withEvent:] + 572
frame #20: 0x000000018e1dd9e0 UIKit`-[UIWindow _sendTouchesForEvent:] + 2428
frame #21: 0x000000018e1d2890 UIKit`-[UIWindow sendEvent:] + 3160
frame #22: 0x000000018e1d11d0 UIKit`-[UIApplication sendEvent:] + 340
frame #23: 0x000000018e9b2d1c UIKit`__dispatchPreprocessedEventFromEventQueue + 2340
frame #24: 0x000000018e9b52c8 UIKit`__handleEventQueueInternal + 4744
frame #25: 0x000000018e9ae368 UIKit`__handleHIDEventFetcherDrain + 152
frame #26: 0x0000000184397404 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #27: 0x0000000184396c2c CoreFoundation`__CFRunLoopDoSources0 + 276
frame #28: 0x000000018439479c CoreFoundation`__CFRunLoopRun + 1204
frame #29: 0x00000001842b4da8 CoreFoundation`CFRunLoopRunSpecific + 552
frame #30: 0x0000000186299020 GraphicsServices`GSEventRunModal + 100
frame #31: 0x000000018e2d1758 UIKit`UIApplicationMain + 236
frame #32: 0x000000010298026c SAT Prep`main at AppDelegate.swift:15
frame #33: 0x0000000183d45fc0 libdyld.dylib`start + 4
Ah, the issue for Google Auth is the line
authUI?.shouldAutoUpgradeAnonymousUsers = true
Is there anything else I need to do to enable auto upgrade?
The auto-upgrade code should just work automatically. Can you check if this is the case for all Google account logins? It may be an edge case for logins that are already linked to anonymous accounts.
@Yue-Wang-Google FYI
I was able to log in successfully with shouldAutoUpgradeAnonymousUsers enabled for accounts that were not linked or being linked to anonymous accounts, so this isn't a regression, just a bug in new behavior.
Phone auth didn't crash either. Can you provide the format string that's being passed into the stringWithFormat: call before the crash (or share the project that reproduces the crashes)?
Ah, the TermsSMS translation string is using a different string format, and it is not updated for languages other than English.
see https://github.com/firebase/FirebaseUI-iOS/commit/1f49c883531295131665ad9af5ebced3301ed713#diff-ba025ad8f89db2a4711d0fb284befb9b
@morganchen12 what should we do in this case?
We should fix this by updating the string localizations.
The Google auth issue we'll have to investigate separately.
The patch will fix the crash. original code has stack issue --- it's expecting 3 args from stack but instead gets only 1.
The fix will resolve crashing issue for all languages.
Reopening since the Google issue still remains.
can you release a new version for this fix ? @Yue-Wang-Google
@wangjiejacques the crash fix has been released in 5.1.3.
Will the fix for Google auto upgrade also be going out soon? And do you know if it also affects upgrade using phone and email?
The expected behavior should be that the user is just signed in to the account that's already linked and the new anonymous user data is no longer used, right?
@ibru since I think you added most of this functionality, would you possibly know how to address this issue?
@lswang1618 sorry, I have no idea what could be causing this issue.
@lswang1618 I'll take a look at the Google auth upgrade issue this week. It shouldn't affect upgrade with phone and email.
Thanks Morgan!
This should be fixed in 5.2.0. Please comment here if it's not and I'll reopen the issue.
Thanks!
Verified - thanks!
Ah, not sure what's happening, but providerData is empty when I set auto upgrade to true, but includes auth data when set to false.