Java.Lang.NoClassDefFoundError在实现firebase云消息传递时出错



我正在使用Firebase云消息实现推送通知,为此我在AndroidManifest.xml文件中添加了这段代码

<!--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-->

但是当我尝试运行应用程序时,它甚至在启动活动之前就抛出了应用程序

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

顺便说一下,我已经为这个功能安装了两个NuGet包:

  1. Xamarin。GooglePlayServices。底座
  2. Xamarin。Firebase。信息

我试过:

  1. 删除bin和obj文件夹并重新构建解决方案
  2. 将所有相同的家族金块包更新为相同的版本

安装Xamarin。谷歌。dagger包为我解决了这个问题。

只需安装软件包Xamarin。谷歌。dagger这就行了。看起来它正在寻找包裹,但没有找到。

最新更新