错误:包 com.google.firebase.messaging 不存在 [英] error: package com.google.firebase.messaging does not exist

查看:37
本文介绍了错误:包 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
" +
        "";
    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

Xamarin.Build.Download- 0.4.2

  • 清理并构建您的解决方案,以防问题仍然存在,删除 bin 和 obj 文件夹,然后清理构建您的项目.

如果问题仍然存在,请发表评论,以便我跟进.

In case the problem still persists kindly comment so I can follow up.

这篇关于错误:包 com.google.firebase.messaging 不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆