2
votes

Trying to get Firestore imported into my application but keep getting the error "Invariant Violation: Native module cannot be null" I was looking through some solutions and people were saying to run pod install in ios but the ios folder doesn't exist in expo? Not sure what to do...

My import it import firestore from '@react-native-firebase/firestore'; I am using firebase auth and that is working fine but no luck with the firestore.

enter image description here

3

3 Answers

0
votes

You cannot use react-native-firebase with expo. See this guide from expo about using the firebase sdk.

0
votes

I resolved this by going to node_modules > @react-native-firebase then opening the app and database folders and deleting any node_modules folders I found inside of those

0
votes

I also had this error. As a solution, I didn't import from '@react-native-firebase/firestore'. I used only 'import firebase from "firebase";' and I used in code block this 'firebase.firestore()'. It is worked.