Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin.android Default FirebaseApp is not initialized in this process

I face issue with get token from firebase (push notification)

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

even I called FirebaseApp.InitializeApp(this); in many places

MyApplication (that extend Application) , in onCreate of Activity where I call FirebaseInstanceId.Instance?.Token;

like image 658
Mina Fawzy Avatar asked May 24 '17 14:05

Mina Fawzy


People also ask

Do I need to call firebaseapp initializeapp from mainactivity anymore?

One thing you don't need to do any more is to call FirebaseApp.initializeApp (this) from your MainActivity.OnCreate () method. If you're doing this, you should probably remove that call, as it's unnecessary and may cause downstream complications.

How to initialize firebase in Android?

Try to initialize firebase within your Application class (OnCreate method). But first download the google-services.json file from the project console, and make sure it has the "GoogleServicesJson" value as Build Action.

How to initialize default firebaseapp in Nebka?

Default FirebaseApp is not initialized in this process com.ready_apps.Nebka.Business. Make sure to call FirebaseApp.initializeApp (Context) first. MyApplication (that extend Application) , in onCreate of Activity where I call FirebaseInstanceId.Instance?.Token;


1 Answers

Edit: This bug has been fixed in Xamarin.Firebase version 57.1104.0-beta1.

This error seems to be present in the newer versions of Firebase for Xamarin. I am also experiencing this error as of today, using the latest stable version 42.1021.1. (The error is also present in the latest beta build).

I found that a bug report has been filed for the issue here.

As mentioned in the bug report, deleting both the /obj and /bin folders in your Android project, and/or cleaning the project in Visual Studio should fix the problem temporarily until you update any resource that would change the Resource.Designer.cs file.

Downgrading to an older version of Firebase and Google Play Services is also possible before a permanent solution is available. I did not experience this error on Firebase and Google Play Services version 32.961.0, for example.

like image 139
nekris Avatar answered Sep 18 '22 13:09

nekris