I followed https://rnfirebase.io/#managed-workflow guide on how to install Firebase. I created a new Expo app with:
npx create-react-native-app -t with-dev-client
As written in the guide. I then did
npx expo install @react-native-firebase/app
npx expo install @react-native-firebase/auth
Having nothing in the project except a Button which, when pressed creates an account with createUserWithEmailAndPassword.
This is when I am presented with this error:
Error: You attempted to use a firebase module that’s not installed on your Android project by calling firebase.app().
Ensure you have:
- imported the ‘io.invertase.firebase.app.ReactNativeFirebaseAppPackage’ module in your ‘MainApplication.java’ file.
- Added the ‘new ReactNativeFirebaseAppPackage()’ line inside of the RN ‘getPackages()’ method list.
See http://invertase.link/android for full setup instructions.
Did I mess up on the way, or is there more steps than the guide suggests, or is the way I created the app the cause?
This was tested on an Android Emulator, launched by pressing ‘a’ in the terminal.
I appreciate any help!
Additional info:
I added the Google services as shown in the guide, with the name corresponding to the package name given in app.json.
Running expo prebuild –clean:
It says "(node:14360) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package" which I don’t know if it could create an issue such as this.
2
Answers
You need to install
@react-native-firebase/app
module and initialize, then only you can use any of the@react-native-firebase/xxx
modules. check the official documentation for authorization module here.Start the service using
Meanwhile, before then, you should have created a –dev-client build using
**You will need to have an eas account if not. This will create a development build version of your project, just like the expo-go but specifically for the project will all the firebase dependencies that you have added being active. It is also the procedure for testing firebase push notification.
Fore more information, please visit:
Create Development Build – Expo Documentation