Googleplayservicescomponents: AndroidX Branch - Unable to Find FirebaseMessagingService

Created on 9 Dec 2019  路  12Comments  路  Source: xamarin/GooglePlayServicesComponents

Xamarin.Android Version (eg: 6.0):

AndroidX

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

Windows 10

Google Play Services Version (eg: 8.4.0):

Describe your Issue:

I added the FirebaseMessagingService file to Firebase.Messaging (update Firebase.iid also). Built without any errors but cannot access the
FirebaseMessagingService in Firebase.Messaging NuGet

Steps to Reproduce (with link to sample solution if possible):

  • Add FirebaseMessageingService to Firebase.Messaging
  • Add file reference to project file
  • Update Firebase.idd
  • Build

Include any relevant Exception Stack traces, build logs, adb logs:

No exception, no errors just cannot see newly added FirebaseMessaingService class in Firebase.Mesaaging

All 12 comments

I too am suffering this issue

I too am suffering this issue

Yeah, but strangely I added it manually and re-built - Still don't see the FirebaseMessagingService under Firebase.MEssaging

@aliusman @eman1986
To recap:

  1. you are building AndroidX branch on your own (cos there is no nugets released yet)
  2. using those nugets from local (or private) feed you get error that FirebaseMessagingService is not available.

Now a little binding school (for free) and optional (if you want to help):

  1. check api.xml in the binding for artifact you know (or you'd expect) class should appear
  2. if there is no class with name="FirebaseMessagingService" decompile jar for artifact (with Luyten) and search for FirebaseMessagingService

Report here (big please)
Then we can see why it was not surfaced.

my issue was actually unrelated, mine had to do with D8 not liking something.

I don't mind helping out :)

@aliusman @eman1986
To recap:

  1. you are building AndroidX branch on your own (cos there is no nugets released yet)
  2. using those nugets from local (or private) feed you get error that FirebaseMessagingService is not available.

Now a little binding school (for free) and optional (if you want to help):

  1. check api.xml in the binding for artifact you know (or you'd expect) class should appear
  2. if there is no class with name="FirebaseMessagingService" decompile jar for artifact (with Luyten) and search for FirebaseMessagingService

Report here (big please)
Then we can see why it was not surfaced.

Thanks for the reply @moljac

- Yes, I Built Androidx branch on my own and using nugets from local

For the build process

  • I Added FirebaseMessageingService to Firebase.Messaging
  • Added file reference to a project file for Firebase.Messaging

Built and got a build error as "Could not found a reference to "Firebase.Iid.Zzb"

  • Added Zzp to Firebase.Iid
  • Added file reference to the project file to Firebase.Iid
  • Built and built was completed successfully with 0 errors

  • Ensured that the Nugets were updated

  • Updated Nugets to Visual Studio and Clear all Caches

Now when I try to access the FirebaseMessagingService I can't find it as per the following screenshot
image

- Yes, I can see FirebaseMessagingService class in api.xml

my issue was actually unrelated, mine had to do with D8 not liking something.

I don't mind helping out :)

my issue was actually unrelated, mine had to do with D8 not liking something.

I don't mind helping out :)

Do you mean you can find FirebaseMessagingService class after the build?

it was complaining about different namespaces with firebase, I've since resolved it

it was complaining about different namespaces with firebase, I've since resolved it

be able to share your final build for com.google.firebase.firebase-messaging

@eman1986

I don't mind helping out :)

Nice. Glad to hear.

I've since resolved it

We might need more ingo on this.

@aliusman

To recap (again):

  • I Added FirebaseMessageingService to Firebase.Messaging
  • Added file reference to a project file for Firebase.Messaging

So you added a file with class FirebaseMessageingService? Correct me if I'm wrong.

This is not how it is done. There must be reason why class was not surfaced by our tools. The reasons could be numerous. They way you have done is tedious (it could be done, but almost impossible, our tools generate tons of code)

You way leads to the errors like:

Built and got a build error as "Could not found a reference to "Firebase.Iid.Zzb"

  • Added Zzp to Firebase.Iid
    *Added file reference to the project file to Firebase.Iid
  • Built and built was completed successfully with 0 errors
  • Ensured that the Nugets were updated
  • Updated Nugets to Visual Studio and Clear all Caches

ZZb is obfuscated class and those cause issues too. Adding those classes like you did will shut up the compiler, but it will cause ACW (Android Callable Wrapper) genration errors or even worse runtime crashes.

Important is your statement:

  • Yes, I can see FirebaseMessagingService class in api.xml

This must be before your additions (fo classes) and api.xml class is in

obj/${Configuration}/${TargetFramewrok}/api.xml

so after Cake build:

obj/Release/monoandroid90/api.xml

I'm focused on AndroidX release right now, so I hope I will be able to take a look over the weekend and next week.

So you added a file with class FirebaseMessageingService? Correct me if I'm wrong.

You are correct

This is not how it is done. There must be reason why class was not surfaced by our tools. The reasons could be numerous. They way you have done is tedious (it could be done, but almost impossible, our tools generate tons of code)

Ah, I thought I was going the wrong way, but the strange thing is Firebase.Iid.Zzb was updated successfully and I could see it my updated NuGet

I'm focused on AndroidX release right now, so I hope I will be able to take a look over the weekend and next week.

Thank you so much :) 馃憤 馃 Let me know if you need any help 馃憤 **

you are right, there must be a reason this was left alone for now, one thing to point out though for testing purposes I added the Firebase.Messaging.FirebaseMessagingService directly to my project and it works as intended, I did the live testing for this and it seems to function properly.
image
Something I thought worth pointing out.

here is the Firebase.Iid.Zzb refrence used by FirebaseMessagingService
image

@aliusman @eman1986

Fixed in
https://github.com/xamarin/GooglePlayServicesComponents/commit/ff0410a6d081af4e5d1a3b14c98433feb58d693a

Samples to go in order to publish preview nugets.

Closing this one

Was this page helpful?
0 / 5 - 0 ratings