I've looked at every question on the net regarding this bug. It seams to have been very common with versions < 42.1021.1. But I have the newest version and the bug is still occurring.
I have added my google-services.json and selected the appropriate build action. I have tried the clean and rebuild with no success. I also tried workarounds for the bugs in other versions like adding the Target tag in the csproj file. I've tried manually entering the strings from the json.
Whatever I do calling FirebaseApp.InitializeApp(this) returns null and when I try to reference FirebaseInstanceId.Instance.Token I get the very common exception:
Java.Lang.IllegalStateException: Default FirebaseApp is not initialized in this process Make sure to call FirebaseApp.initializeApp(Context) first.
Github and Xamarin forums say this was fixed with 60.1141.1, it never was. I also went through my csproj to ensure all references to GoogleServices were for the newest version.
I have no idea why this won't work and I really need this soon for work. Please help if you can.
I've looked at the following resources with no success: Getting Exception Using Firebase in Xamarin Android https://learn.microsoft.com/en-us/xamarin/android/data-cloud/google-messaging/remote-notifications-with-fcm?tabs=vswin https://bugzilla.xamarin.com/show_bug.cgi?id=56108#c1 Default FirebaseApp is not initialized https://forums.xamarin.com/discussion/94464/firebase-cloud-messaging-app-not-initialized Xamarin.android Default FirebaseApp is not initialized in this process
and more I can't track down. Why is this bug still occurring on this version????