23

I am implementing push notifications using Firebase Cloud Messaging, for this I added this code in my AndroidManifest.xml file

<!--FCM RECEIVER-->
<receiver
  android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
  android:exported="false"/>
<receiver
  android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
  android:exported="true"
  android:permission="com.google.android.c2dm.permission.SEND">
  
  <intent-filter>
    <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
    <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
    <category android:name="${applicationId}"/>
  </intent-filter>    
</receiver>
<!---FCM RECEIVER ENDS HERE-->

but when I try to run the application, it throws the application even before starting the activity

Java.Lang.NoClassDefFoundError: 'Failed resolution of: Lcom/google/android/datatransport/runtime/dagger/internal/Factory;'

By the way, I had Installed two NuGet Packages for this functionality:

  1. Xamarin.GooglePlayServices.Base
  2. Xamarin.Firebase.Messaging

I have tried:

  1. deleting the bin and obj folder and building the solution again
  2. updating all the same family nugget packages to the same version
officer
  • 1,190
  • 1
  • 13
  • 25
Asad Ullah
  • 365
  • 2
  • 7

2 Answers2

58

Installing the Xamarin.Google.Dagger package solved this problem for me.

sobo
  • 598
  • 5
  • 5
4

Just Install the package Xamarin.Google.Dagger. That should do the trick. Seems it's trying to look for the package but doesn't find it.

Dharman
  • 21,838
  • 18
  • 57
  • 107