Default FirebaseApp is not initialized exception
Closed this issue · 6 comments
I've followed the Getting Started tutorial and once I run my app, I get this exception on the line where this is:
AzurePushNotificationManager.Initialize(this, AzureConstants.ListenConnectionString, AzureConstants.NotificationHubName, true);
The exception says this:
Java.Lang.IllegalStateException: 'Default FirebaseApp is not initialized in this process com.company.xxx. Make sure to call FirebaseApp.initializeApp(Context) first.'
I've tried calling the FirebaseApp.initializeApp(this)
first, it didn't help.
I've also tried switching from debug to release configuration, also didn't help.
I'm using these nugets:
Xamarin.Forms 4.4.0.991537
Plugin.AzurePushNotifications 2.0.23
My android app is targeting API 29 (Android Q).
You need to add Xamarin.Firebase.Messaging package to Android project
I'll give that a try, thank you.
So I've tried that and I'm still getting the same error. Any other ideas? Thanks
That's it! I installed the Xamarin.GooglePlayServices.Basement in my Xamarin.Forms Android project and the error has gone away. Thank you!
@Char0394 this should probably be added to the docs, or a dependency added to the NuGet.
Adding the NuGet Xamarin.Firebase.Messaging
to the android project and rebuilding fixed the issue.