React Native Error: No Firebase App '[DEFAULT]' has been created - call firebase.initializeApp() How to fix?



Encountering the "No Firebase App '[DEFAULT]' has been created" error in React Native usually indicates that Firebase has not been properly initialized in your application. To resolve this issue, you need to ensure that Firebase is initialized correctly. Here's how you can do it


add the google-services plugin as a dependency inside of your /android/build.gradle file


buildscript {
  dependencies {
    // ... other dependencies
    classpath 'com.google.gms:google-services:4.4.1'
    // Add This 
  }
}


Then, Add this line in /android/app/build.gradle file

apply plugin: 'com.google.gms.google-services'




Run gradlew clean once you're in the android directory, you can run the following command to clean the project


gradlew clean


simply restarting the development server can resolve initialization issues.Once you've confirmed and rectified any problems with initializing Firebase, the error should be eliminated. Afterward, you should be able to utilize Firebase services in your React Native application without experiencing the "No Firebase App '[DEFAULT]' has been created" issue
Post a Comment (0)
Previous Post Next Post