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.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@19.3.0:184)
at com.urbanairship.push.fcm.FcmPushProvider.isAvailable(FcmPushProvider.java:88)
at com.urbanairship.push.PushManager.performPushRegistration(PushManager.java:1017)
at com.urbanairship.push.PushManager.extendChannelRegistrationPayload(PushManager.java:331)
at com.urbanairship.push.PushManager.access$000(PushManager.java:53)
at com.urbanairship.push.PushManager$1.extend(PushManager.java:288)
at com.urbanairship.channel.AirshipChannel.getNextChannelRegistrationPayload(AirshipChannel.java:522)
at com.urbanairship.channel.AirshipChannel.onPerformJob(AirshipChannel.java:222)
at com.urbanairship.job.Job$1.run(Job.java:90)
at com.urbanairship.util.SerialExecutor$1.run(SerialExecutor.java:41)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.urbanairship.util.AirshipThreadFactory$1.run(AirshipThreadFactory.java:50)
at java.lang.Thread.run(Thread.java:923)
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

Comments

1 comment

  • 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

Please sign in to leave a comment.