-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
App crash on using secondary firebase app on iOS #5134
Comments
Interesting! Can you make a single App.js I could throw into a clean project to reproduce this quickly? That's the best chance for a crash fix - +1 that you're using current versions of react-native-firebase but you ignored the rest of the template unfortunately so I can't tell if you have some other versioning issue (perhaps overriding firebase-ios-sdk to an old version? I can't say: you ignored the template) |
@mikehardy Please find the required files as follows: package.json
Podfile
App.js
Screenshot of crashes: |
This is not a complete self-contained App.js - you There is a lack of try/catch everywhere, meaning that when I correct the import above to Nevertheless, after hacking around on your App.js I can reproduce this, not sure what the problem is yet, but I can get the same redbox Note that you can do:
...according to the docs but if I try 2 it appears to attempt connection to the default app still, not the secondary one. So there may be more than one thing happening here. Also note that I since you have publicly shared the API keys here you should consider that firebase project compromised - do not use it for anything important, make sure there is not a billing account connected to it and make sure to delete as soon as we are done troubleshooting. |
Previously the exceptions were swallowed, meaning that initialization failures were very difficult to diagnose, leading to developer confusion Fixes #5134
@DarshitaGoMmt your secondary configuration is invalid, as a proximal cause - you need to use a valid app id for iOS I think That is a project-specific problem, so I am going to close this issue, as a valid config will work. The crash is also a derivative item, the root cause is that initializeApp on iOS was swallowing configuration errors, so you had no way of knowing your configuration was invalid, so you continued ahead and were actually using a null native secondary app #5154 will fix that issue so that errors will be easy to see going forward. Until that fix is released you should incorporate the patches (via patch-package) from the PR artifact here: https://github.com/invertase/react-native-firebase/actions/runs/736591451 It does contain a few patches at this point as we have a queue of unreleased changes since v11.2.0, if you want to just reach in to |
@mikehardy The configuration has been copied from firestore project setting for a web app (which is working fine on Android). How can I ensure whether the config is valid or invalid? The config shared is created specifically for sharing the issue will delete the project once issue is resolved. |
@mikehardy As @DarshitaGoMmt mentioned, we are using same firebase config for our Android (via react-native-firebase |
It's an invalid app Id, I saw the exception personally while reproducing it myself. Using an ios config worked. |
Previously the exceptions were swallowed, meaning that initialization failures were very difficult to diagnose, leading to developer confusion Fixes #5134
@mikehardy Auth worked on trying with iOS based app config while on Android it worked with web app config also. Since on adding iOS app it provides GoogleService-info.plist so it created confusion as we don't add more than one GoogleService-info.plist. So what we did now is, extracted all config related info from GoogleService-info.plist and used it. This made secondary app worked on iOS! |
Previously the exceptions were swallowed, meaning that initialization failures were very difficult to diagnose, leading to developer confusion Fixes #5134
Previously the exceptions were swallowed, meaning that initialization failures were very difficult to diagnose, leading to developer confusion Fixes #5134
Previously the exceptions were swallowed, meaning that initialization failures were very difficult to diagnose, leading to developer confusion Fixes #5134
Previously the exceptions were swallowed, meaning that initialization failures were very difficult to diagnose, leading to developer confusion Fixes #5134
Previously the exceptions were swallowed, meaning that initialization failures were very difficult to diagnose, leading to developer confusion Fixes invertase#5134
package.json-
When using auth-
Exception '*** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil' was thrown while invoking addAuthStateListener on target RNFBAuthModule with params (
![image](https://user-images.githubusercontent.com/50611959/114024247-6fe6ab00-9891-11eb-96fc-b69497bc31e0.png)
"GUEST_CHAT"
)
This is working fine on Android but failing on iOS.
The text was updated successfully, but these errors were encountered: