Firebase not intialise android react native

I am building an app for android from react native. 

I am able to setup everything but once I run the project in android I get this error. Please help me to resolve this I am unable to find anything related to this.

2020-07-24 11:11:43.951 3200-3229/com.basicstructure E/BasicStructure - UALib: Unable to register with FCM.

java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.basicstructure. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.urbanairship.push.fcm.FcmPushProvider.isAvailable(
at com.urbanairship.push.PushManager.performPushRegistration(
at com.urbanairship.push.PushManager.extendChannelRegistrationPayload(
at com.urbanairship.push.PushManager.access$000(
at com.urbanairship.push.PushManager$1.extend(
at com.urbanairship.job.Job$
at com.urbanairship.util.SerialExecutor$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$
at com.urbanairship.util.AirshipThreadFactory$
2020-07-24 11:11:43.951 3200-3229/com.basicstructure W/BasicStructure - UALib: PushManager - Push registration failed. Push provider unavailable: FCM Push Provider 13.3.0

Didn't find what you were looking for?

New post



  • Hello Krupali!

    This is Mikey with Airship Technical Support. Thank you for providing these log files. It looks like your Firebase integration is not properly configured to register for push notifications with Airship. I recommend reviewing our documentation on the React Native Android setup to ensure that no steps were missed in the process. Specifically, the implementation of the google-services.json from the application’s Firebase console into the root directory at android/app/google-services.json. 

    If you are using a third-party push provider in tandem with Airship, you'll need to follow the steps outlined here to forward onNewToken and onMessageReceived received calls to the Airship SDK. 


    If all else fails, we strongly encourage using our Sample App for React Native to build a working implementation that can help you better understand where the break down is happening. 

    I hope this helps!

    Mikey R.

    Airship | Technical Support Engineer | Portland, OR

    Comment actions Permalink
  • Solved by:

    completely removed all react-native-firebase references in android/ folder: manually unlinked the project, remove 'apply plugin' at the bottom of android/app/build.gradle file, removed gms dependency in android/build.gradle, cleaned AndroidManifest.xml from react-native-firebase services and receivers
    npm uninstall --save react-native-firebase
    cd android && ./gradlew clean

    Then I had to update all my play-services dependencies in android/app/build.gradle to 11.6.0 version, because firebase is using 11.6.0 at the moment I'm writing this post.

    Here is how my android/app/build.gradle dependencies block looks like:

    dependencies {

        compile(project(':react-native-firebase')) {
        transitive = false

        // Firebase dependencies
        compile ""
        compile ""

        compile project(':react-native-background-timer')
        compile(project(':react-native-maps')) {
            exclude group: ''

        compile (project(':react-native-device-info')) {
            exclude group: "" 

        compile (project(':react-native-camera')) {
        exclude group: ""

        compile project(':react-native-image-picker')
        compile project(':react-native-oauth')
        compile project(':react-native-svg')
        compile project(':react-native-vector-icons')
        compile project(':react-native-device-info')
        compile project(path: ':react-native-interactable')
        compile project(':react-native-photo-view')

        compile fileTree(dir: "libs", include: ["*.jar"])
        compile ""
        compile "com.facebook.react:react-native:+"  // From node_modules

        compile ("") {
            force = true;
        compile ("") {
            force = true;
        compile ("") {
            force = true;

        compile project(':react-native-facebook-login')
        compile project(':react-native-check-app-install')
        compile project(':react-native-fetch-blob')

        compile project(':non-conflicting-webview')

    Rachel Gomez
    Comment actions Permalink

Please sign in to leave a comment.