-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[🐛] auth.PhoneAuthProvider.credential is undefined on IOS release build #8444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
having same issue with Google Auth auth.GoogleAuthProvider.credential credential part is undefined this is only happening in production build, i am on latest verion of react native and react native firebase. LOG CAT 04-07 15:23:19.733 24918 24984 I ReactNativeJS: { [Function: f] <--- this is console.log(auth)
04-07 15:23:19.733 24918 24984 I ReactNativeJS: AppleAuthProvider: [Function: t],
04-07 15:23:19.733 24918 24984 I ReactNativeJS: EmailAuthProvider: [Function: t],
04-07 15:23:19.733 24918 24984 I ReactNativeJS: PhoneAuthProvider: [Function: t],
04-07 15:23:19.733 24918 24984 I ReactNativeJS: GoogleAuthProvider: [Function: t],
04-07 15:23:19.733 24918 24984 I ReactNativeJS: GithubAuthProvider: [Function: t],
04-07 15:23:19.733 24918 24984 I ReactNativeJS: TwitterAuthProvider: [Function: t],
04-07 15:23:19.733 24918 24984 I ReactNativeJS: FacebookAuthProvider: [Function: t],
04-07 15:23:19.733 24918 24984 I ReactNativeJS: PhoneMultiFactorGenerator: { [Function: t] FACTOR_ID: 'phone' },
04-07 15:23:19.733 24918 24984 I ReactNativeJS: OAuthProvider: [Function: t],
04-07 15:23:19.733 24918 24984 I ReactNativeJS: OIDCAuthProvider: [Function: t],
04-07 15:23:19.733 24918 24984 I ReactNativeJS: PhoneAuthState:
04-07 15:23:19.733 24918 24984 I ReactNativeJS: { CODE_SENT: 'sent',
04-07 15:23:19.733 24918 24984 I ReactNativeJS: AUTO_VERIFY_TIMEOUT: 'timeout',
04-07 15:23:19.733 24918 24984 I ReactNativeJS: AUTO_VERIFIED: 'verified',
04-07 15:23:19.733 24918 24984 I ReactNativeJS: ERROR: 'error' },
04-07 15:23:19.733 24918 24984 I ReactNativeJS: getMultiFactorResolver: [Function],
04-07 15:23:19.733 24918 24984 I ReactNativeJS: multiFactor: [Function] }
04-07 15:23:19.733 24918 24984 I ReactNativeJS: [Function] <-- this is console.log(auth.GoogleAuthProvider)
04-07 15:23:19.733 24918 24984 I ReactNativeJS: ERROR AT auth.GoogleAuthProvider.credential
04-07 15:23:19.733 24918 24984 I ReactNativeJS: [TypeError: undefined is not a function] |
This issue appears to be similar, can you see if the users solution also works for you? #8315 |
Hi @MichaelVerdon, indeed it's very similar, that's why I've mentioned the issue in the description as well The user ignored the problem by not using the function at all, which is not an option for us. We still need the credential function in our scenario as attached in the javascript section of the issue, |
Very strange - @MichaelVerdon note that I added the ability to do release-mode testing for android and ios recently in our e2e app, so we should be seeing this. It won't be possible to check the GoogleAuthProvider easily as it requires some provisioning the e2e app doesn't have, but the PhoneAuthProvider should be testable (and should already have tests executing!) in the e2e harness. There were a couple other issues only showing up in release mode and I wanted to try to detect debug/release mode skew in CI so this sort of thing wouldn't happen In fact, we do test this: https://github.com/invertase/react-native-firebase/actions/workflows/tests_e2e_ios.yml Why are we not seeing this? 🤔 |
Is it possible that it may have been optimized away somehow by the compiler? I just don't have any other explanation why the function may not be available only on release builds ... |
Do you have any updates on this? We are blocked on releasing our app because of the phone authentication :( |
No updates sorry, this isn't something we've been able to reproduce - as indicated above - we test this, in release mode even, and we don't see the problem as described. Until we have a reproduction I'm not sure what we can do |
Seeing as this issue is only with Google provider, please ensure you have REVERSE_CLIENT_ID in your google-services file. |
@MichaelVerdon thank you for your time, I just checked again and I confirm we have |
Same error here! auth.GoogleAuthProvider.credential and auth.AppleAuthProvider.credential are undefined in release build only on iOS. I tried Xcode 16.1, 16.2, 16.3 and the library versions 21.12.0 21.14.0 and 22.0.0. No luck :( |
To give more context, the problem is that Metro is, for some reason, deleting the files when compiling the bundle. If you disable JS code deobfuscation in release mode, it works correctly (although it's not recommended). For anyone reading this and needing a temporary fix, copy the files from https://github.com/invertase/react-native-firebase/tree/main/packages/auth/lib/providers directly into your project and export them from there. I hope this helps solve the issue 💪🏼 |
@pablorodlep thanks a lot for that report! That should help us figure out what is going on, and obviously a temporary workaround isn't great but it is 100% than no workaround. Thanks |
edited: I've tested with hermes, it reproduces on hermes as well |
Issue
Just noticed our phone authentication does not work anymore (only on release builds), it seems very very similar to this issue
#8315
More specifically when calling
auth.PhoneAuthProvider.credential
Project Files
Javascript
Click To Expand
package.json
:firebase.json
for react-native-firebase v6:iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:21.13.0
Firebase
module(s) you're using that has the issue:e.g. Instance ID
TypeScript
?Y/N
&VERSION
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: