Search code examples
firebasexamarinxamarin.forms

Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first


Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first.

i have tried with many things but i am not able to Get notifications in devices.

i also tried with below thing.

In the Properties pane, set the Build Action Select google-services.json in the Solution Explorer window.

In the Properties pane, set the Build Action to GoogleServicesJson (if the GoogleServicesJson build action is not shown, save and close the Solution, then reopen it):to GoogleServicesJson

Notification was working before, but after I update the xamarin forms to 2.5.0.280555 and Xamarin.Firebase.Messaging.42.1021.1, it stopped working .


Solution

  • Make sure:

    1. Package name in AndroidManifest.xml is identical to one in the google-services.json
    2. google-services.json build action is set to GoogleServicesJson
    3. After step 2 restart your IDE & clean & rebuild
    4. Explicitly call FirebaseApp.InitializeApp(Application.Context); in MainActivity.OnCreate just before the LoadApplication(..)