Updated to v 3.2.4 now getting red screen error
RNFirebase core module was not found natively on ios
Not sure why, Pods for firebase are clearly installed, even went in updated and installed them again just to be sure. Pod file looks like this
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
def shared_pods
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
end
target 'projectName' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for skimitar
shared_pods
end
target 'projectNameDevelopment' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for skimitarDevelopment
shared_pods
end
Attempded various things to fix this and non worked:
1) removed node modules and package lock file, re-installed them
2) updated and nstalled pods
3) cleaned xCode project
4) reset simulator data
@IljaDaderko which version were you updating from? Can you show the code you're using which triggers this error?
@chrisbianca sure thing.
Previous version is: 3.2.3
This is triggered when I spin up my app instantly, so I would assume as soon as I include firebase. My current firebase set up is very simple
import firebase from "react-native-firebase";
const auth = firebase.auth;
export { auth };
auth is latter on used for fb login, but since I can't get to that screen due to error, I don't think it is affecting anything, but just for good measuere here is fb login
export async function facebookSignIn() {
try {
const login = await LoginManager.logInWithReadPermissions(["public_profile", "email"]);
if (!login.isCancelled) {
const token = await AccessToken.getCurrentAccessToken();
const credential = auth.FacebookAuthProvider.credential(token!.accessToken);
const user = await auth().signInWithCredential(credential);
if (!user.emailVerified) await user.sendEmailVerification();
}
} catch (e) {
Alert.alert("Error", e.message);
}
}
And it was definitely working on v3.2.3?
Makes no sense if so as the only thing that's changed between the two versions was to fix a mis-spelling of the admob module which was causing similar errors. And add a few types, but that won't affect anything code wise.
@chrisbianca could you point me to peace of code that throws this error? I will look around it to see if I can figure this out. There is a chance it could've been 3.2.2 as I updated it recently and couldv'e been in the middle of simulation so still using 3.2.2 and thinking 3.2.3 update was successfull
It's the first line of the constructor in lib/modules/firebase.js:
constructor() {
if (!FirebaseCoreModule) {
throw new Error(INTERNALS.STRINGS.ERROR_MISSING_CORE);
}
This is so strange, I mean it should be configured according to this right?
1) Pods installed

2) Firebase included in AppDelegate.m

And I ran react-native link again says everything is linked
3) node_modules/react-native-firebase/ios has all contents as well
@chrisbianca not sure if this is much help, but it runs fine on Android, so deff something pod related
just importing import firebase from "react-native-firebase"; works fine, it errors as soon as I introduce something like firebase.auth
@chrisbianca only related change I can see from releases is https://github.com/invertase/react-native-firebase/compare/v3.2.3...master#diff-9ff5c11117635893f8e65ed5da08a815
Mentions native modules / constructors etc.. but its for admob which I don't even use. I will try setting this up with fresh react native project tomorrow and see if issue still persists
After a lot of fiddling I solved this one. There is a folder named Recovered Refferences that is auto generated by XCode apparently, for some odd reason when I ulled my project fresh it did not appear in XCode, this is where facebook sdk and react native firebase refferences were stored.
After I got home and opened it on another machine it was there and working, so I remoevd repository completely from my laptop (where issue was), pulled it fresh and everythign is fine.
@IljaDaderko Hi Ilja! I'm having the same issue that you had. I found the Recovered References folder, but I'm kind of unsure exactly what to do. I tried uninstalling the pods and npm for RNFirebase and then fresh reinstalling, but the issue persists. I tried manually adding the RNFirebase library from its project in the Libraries folder but that didn't seem to work either. Do I need to delete the Recovered References folder?
@arminsal1 no, keep it. Do you have a file inside it related to RNFirebase? if so than issue is likely not it :/ Do you get same error as i do i.e. red screen saying RNFirebase native module was not found?
@IljaDaderko Yeah there's a libRNFirebase.a file in the Recovered References folder. My issue is a little different: I don't get a red error, but when I attempt to login with Facebook credentials using const credential = firebase.auth.FacebookAuthProvider.credential(accessTokenData.accessToken) I get a warning saying
Possible Unhandled Promise Rejection (id: 0):
TypeError: undefined is not an object (evaluating '_Firebase2.default.auth.FacebookAuthProvider.credential')
I thought maybe our issues are related since you mentioned it was related to firebase.auth and this happened after I upgraded to 3.2.4 as well
@arminsal1 oh your issue is completely different in this case, you got to determine what your undefined is i.e
console.warn(firebase)
console.warn(firebase.auth)
console.warn(firebase)
console.warn(firebase.auth.FacebookAuthProvider)
console.warn(firebase.auth.FacebookAuthProvider.credential)
console.warn(accessTokenData)
se which one is undefined, my guess is that its accessTokenData ?
@arminsal1 Out of interest, is your firebase instance actually a firebase.app() instance? If so, then this is your problem. The providers should never have been available on the app() instances as per the web SDK spec. We fixed this as part of an internal tidy up to the lib which allowed us to get Flow and Typescript working better...
You'll want to access the providers from the raw firebase instance imported from react-native-firebase:
firebase.auth.FacebookAuthProvider.credential()
@chrisbianca You're my savior! Using the raw firebase instance instead of the app() instance fixed the issue! Thanks a ton!
I had this issue after installing using pods. I ran react-native link after installing, and it seems to work now. It seems like I had to install it twice, which is odd, but hey, it works!
Just kidding, the issue came back. I fixed the issue by adding the RNFirebase pod (as the error actually specifies).
Add to pod:
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
Still have this error. I have added RNFirebase to my pod file as above as well as running react-native link. Any ideas?
After adding RNFirebase to Podfile, remove app from simulator and run react-native run-ios again works for me.
Most helpful comment
Still have this error. I have added RNFirebase to my pod file as above as well as running react-native link. Any ideas?