错误:包com.google.firebase.messaging不存在
我正在尝试构建项目,但是当我这样做时,会出现以下错误:错误:com.google.firebase.messaging软件包不存在",以及其他4种同类错误.
I'm trying to build my project, but when I do, I get this error: "error: package com.google.firebase.messaging does not exist", along with other 4 errors of the same kind.
package md5f64326b4609986d97810cf2ced03c9ce;
public class MyFirebaseMessagingService
extends com.google.firebase.messaging.FirebaseMessagingService
implements
mono.android.IGCUserPeer
{
/** @hide */
public static final String __md_methods;
static {
__md_methods =
"n_onMessageReceived(Lcom/google/firebase/messaging/RemoteMessage;)V:GetOnMessageReceived_Lcom_google_firebase_messaging_RemoteMessage_Handler\n" +
"";
mono.android.Runtime.register ("FCMClient.MyFirebaseMessagingService, LimBands.Droid, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", MyFirebaseMessagingService.class, __md_methods);
}
public MyFirebaseMessagingService ()
{
super ();
if (getClass () == MyFirebaseMessagingService.class)
mono.android.TypeManager.Activate ("FCMClient.MyFirebaseMessagingService, LimBands.Droid, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { });
}
public void onMessageReceived (com.google.firebase.messaging.RemoteMessage p0)
{
n_onMessageReceived (p0);
}
private native void n_onMessageReceived (com.google.firebase.messaging.RemoteMessage p0);
private java.util.ArrayList refList;
public void monodroidAddReference (java.lang.Object obj)
{
if (refList == null)
refList = new java.util.ArrayList ();
refList.add (obj);
}
public void monodroidClearReferences ()
{
if (refList != null)
refList.clear ();
}
}
这是我的整个文件,位于obj文件夹中.我已经尝试删除bin/obj文件夹,手动删除并重新安装所有nuget软件包,更改nuget软件包版本(降级和升级),但是似乎没有任何作用.
This is my whole file, it is on the obj folder. I already tried deleting the bin/obj folders, manually deleting and reinstalling all nuget packages, changing nuget package versions (downgrading and upgrading), but nothing seems to work.
我什至将某些文件与另一种工作方式相同的解决方案进行了比较,但没有发现差异.
I even compared some files with another solution that works the same way, and I found no differences.
UPDATE
似乎更新为以下所有软件包的最新版本,并将Xamarin.Build.Download
更新为0.4.11
,也可以解决此问题.
UPDATE
It seems updating to the latest version of all the below packages and updating Xamarin.Build.Download
to 0.4.11
also solves the issue.
您当前面临的问题是Xamarin尚未提供适当解决方案的常见问题,因此上次遇到此问题时我已解决了此问题.
The problem you are facing right now is a common problem to which a proper solution has not been provided by Xamarin so there is this workaround I made up the last time I faced this problem.
如果您同时使用Google地图和Firebase Cloud Messaging,则需要执行以下步骤:
If you are using both Google maps and Firebase Cloud Messaging the following are the steps you need to take:
- 在您的引用中检查以下DLL的版本,并升级或降级您的引用以匹配这些版本:
Xamarin.Firebase.Common
-42.1021.1
Xamarin.Firebase.Common
- 42.1021.1
Xamarin.Firebase.lid
-42.1021.1
Xamarin.Firebase.lid
- 42.1021.1
Xamarin.Firebase.Messaging
-42.1021.1
Xamarin.Firebase.Messaging
- 42.1021.1
Xamarin.GooglePlayServices.Base
-42.1021.1
Xamarin.GooglePlayServices.Base
- 42.1021.1
Xamarin.GooglePlayServices.Basement
-42.1021.1
Xamarin.GooglePlayServices.Basement
- 42.1021.1
Xamarin.GooglePlayServices.GCM
-42.1021.1
Xamarin.GooglePlayServices.GCM
- 42.1021.1
Xamarin.GooglePlayServices.lid
-42.1021.1
Xamarin.GooglePlayServices.lid
- 42.1021.1
Xamarin.GooglePlayServices.Location
-42.1021.1
Xamarin.GooglePlayServices.Location
- 42.1021.1
Xamarin.GooglePlayServices.Maps
-42.1021.1
Xamarin.GooglePlayServices.Maps
- 42.1021.1
Xamarin.GooglePlayServices.Tasks
-42.1021.1
Xamarin.GooglePlayServices.Tasks
- 42.1021.1
- 检查xamarin构建DLL的当前版本是否在0.4.2以上. 降级到0.4.2
- Check the current version of your xamarin build DLL in case it is above 0.4.2 downgrade it to 0.4.2
Xamarin.Build.Download
-0.4.2
- 清理并生成解决方案,以防问题仍然存在,请删除bin和obj文件夹,然后清理生成项目.
如果问题仍然存在,请发表评论,以便我跟进.
In case the problem still persists kindly comment so I can follow up.