In my React Native 0.68.2 app i'm trying to use react-native-firebase and i have done everything except react-native-link as it's not supported in the latest version of React Native. When I run my project, it shows error from the node module of react-native-firebase. I'm guessing it's happening for some version conflict. Here is the long error :
Error: You attempted to use a firebase module that's not installed on your Android project by calling firebase.app().
Ensure you have:
1) imported the 'io.invertase.firebase.app.ReactNativeFirebaseAppPackage' module in your 'MainApplication.java' file.
2) Added the 'new ReactNativeFirebaseAppPackage()' line inside of the RN 'getPackages()' method list.
include ':@react-native-firebase_messaging'
project(':@react-native-firebase_messaging').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/messaging/android')
include ':@react-native-firebase_app'
project(':@react-native-firebase_app').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/app/android')
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
In my React Native 0.68.2 app i'm trying to use react-native-firebase and i have done everything except react-native-link as it's not supported in the latest version of React Native. When I run my project, it shows error from the node module of react-native-firebase. I'm guessing it's happening for some version conflict. Here is the long error :
Here's my app build/gradle file dependencies:
classpath('com.android.tools.build:gradle:7.0.4') classpath('com.facebook.react:react-native-gradle-plugin') classpath('de.undercouch:gradle-download-task:4.1.2') classpath 'com.google.gms:google-services:4.3.13'
And my android/app/build/gradle :
apply plugin: "com.android.application" apply plugin: 'com.google.gms.google-services'
And setting.gradle :
include ':@react-native-firebase_messaging' project(':@react-native-firebase_messaging').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/messaging/android')
include ':@react-native-firebase_app' project(':@react-native-firebase_app').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/app/android')
And MainApplication :
import io.invertase.firebase.messaging.ReactNativeFirebaseMessagingPackage; packages.add(new ReactNativeFirebaseMessagingPackage());
App.js :
app.json :