question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need help > FirebasePushNotificationsPlugin : Default FirebaseApp is not initialized in this process

See original GitHub issue

Hi all,

I updated to the latest version (3.3.10) but now I get this error on Android (working on iOS):

**Java.Lang.IllegalStateException:** 'Default FirebaseApp is not initialized 
in this process com.companyname.firebasetest. 
Make sure to call FirebaseApp.initializeApp(Context) first.'

The error occurs when this FirebaseMessaging.Instance is called.

I found some solutions that does not work for me:

  • My google-services.json has the GoogleServicesJson build action (tried to put it to none again then GSJson)
  • My firebase android app package name is the same package name on my Android project.
  • I updated android’s tools
  • I updated XF and so on
  • Google APIs and Play Store checked
  • Permissions allowed (internet, etc.)
  • Also tried to add this line: FirebaseApp app = FirebaseApp.InitializeApp(Android.App.Application.Context);

PS:

  • I created a new project (and new firebase project) but I get the same error
  • I pulled the sample of the FirebasePushNotification Plugin, and still getting the error
  • Notifications was working with version 2.3.x

What can I do ? I need help

Thank you guys

Bug Information

Version Number of Plugin: 3.3.10 Device Tested On: Samsung A40 Simulator Tested On: Pixel 2 Pie 9.0 API 28 Version of VS: 16.6.0 Version of Xamarin: 4.6

Steps to reproduce the Behavior

Download sample of the plugin and run it.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:7

github_iconTop GitHub Comments

3reactions
Monikaprimecommented, Jul 4, 2020

issue when plugin version is more than 2.3.6 in VS 2019 AND xamarin.forms=4.6 and android sdk build tools is 29

2reactions
ntsbscommented, Aug 11, 2020

It seems that the build action for the GoogleServicesJson is not working correctly. As a workaround initialising firebase as described in this post worked for me: https://stackoverflow.com/a/51381884

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default FirebaseApp is not initialized · Issue #357
Default FirebaseApp is not initialized in this process com.company.app. Make sure to call FirebaseApp.initializeApp(Context) first.
Read more >
Ionic Capacitor firebase push notification, error:Default ...
It seems when using appflow, the ios firebase file is not being placed into the project correctly. – user8400863. Jun 7, 2020 at...
Read more >
Default FirebaseApp is not initialized in this process
Hi all,. I use the FirebasePushNotificationsPlugin to have the push notifications in my project. I updated to the latest version (3.3.10) ...
Read more >
Push Notifications: "Default FirebaseApp is not initialized" ...
Hi! I'm using Unity 2021.3.17f1. New Android application was created, only unity-jar-resolver-1.2.176 and Push Notifications 3.0.1-pre.1 ...
Read more >
Remote Notifications with Firebase Cloud Messaging
Lang.IllegalStateException: Default FirebaseApp is not initialized in this process Make sure to call FirebaseApp.initializeApp(Context) first.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found