GooglePlayServicesComponents icon indicating copy to clipboard operation
GooglePlayServicesComponents copied to clipboard

Xamarin.Firebase.Messaging - help with diagnosing issues

Open paul-charlton opened this issue 3 years ago • 2 comments

Xamarin.Android Version (eg: 6.0):

11

Operating System & Version (eg: Mac OSX 10.11):

Windows 10

Google Play Services Version

Xamarin.Firebase.Messaging v121.0.1

Describe your Issue

Hi, I've been having some issues with Firebase in that it doesn't seem to want to work. Initially the OnNewToken of FirebaseMessagingService (of a new install) wasn't firing. Upon investigation if I added a

FirebaseMessaging.Instance.GetToken()

line into the MainActivity then it threw an exception:

Java.Lang.IllegalStateException: Default FirebaseApp is not initialized in this process XXX. Make sure to call FirebaseApp.initializeApp(Context) first.

Following the instructions just leads to a further error.

I've subsequently created a fresh project and imported the same google-services.json, same package id and even the same references. This fresh project works as expected.

This is a round about way of asking if there are tools or any logs I should be looking for to see why the Firebase app doesn't seem to be building correctly.

Thanks in advance, Paul.

paul-charlton avatar Apr 13 '21 16:04 paul-charlton

Oddly, it seemed it was caused by a tools replace attribute in my AndroidManifest. <application tools:node="replace" removing this did the trick

paul-charlton avatar Apr 13 '21 18:04 paul-charlton

I was going to close, but have left open just in case there is advice about how best to locate these issues?

paul-charlton avatar Apr 13 '21 18:04 paul-charlton