Xamarin iOS-Firebase Analytics不可用 [英] Xamarin iOS - Firebase Analytics is not available

查看:96
本文介绍了Xamarin iOS-Firebase Analytics不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从以下链接下载了示例项目和库: Xamarin Firebase 但配置2天后,启动应用程序时出现此错误:

I have download the example project and library from this link: Xamarin Firebase but after 2 days of configuration i get this error when i launch the app:

[Firebase/Core] [I-COR000022] Firebase Analytics不可用.

[Firebase/Core][I-COR000022] Firebase Analytics is not available.

我没有找到与Xamarin iOS Firebase Analytics的此错误相关的文档,也找不到解决方案.

I did not find documentation related to this error for Xamarin iOS Firebase Analytics and can not find a solution.

我引用了示例项目的相同库,检查了 GoogleService-Info.plist 并将其作为文档插入项目中,称为App.Configure ();.

I have reference the same library of the example project, checked the GoogleService-Info.plist and insert it in the project as documentation, called the App.Configure ();.

无事可做,有人有什么主意吗?

Nothing to do, does anyone have any idea?

推荐答案

已解决!

Firebase Analytics需要3个引用才能工作:

Firebase Analytics requires 3 references to work:

  1. .Core
  2. .Analytics
  3. .IstanceID

仅遵循文档中的代码,在启动时仅加载项目 .Core ,而跳过其他两个,则将导致错误.

Following only the code in the documentation the project at start-up load only .Core skipping the other two, this causes the error.

要变通解决此问题,我添加了 AppDelegate :

To work around this problem, I added in AppDelegate:

using Firebase.Analytics;
using Firebase.InstanceID;

App.Configure ();之前,我添加了以下两行以强制应用程序加载两个程序集:

and before of App.Configure (); i have add this two line to force the app to load the two assemblies:

Firebase.Analytics.Loader loader1 = new Firebase.Analytics.Loader();
Firebase.InstanceID.Loader loader2 = new Firebase.InstanceID.Loader();

当然,如果稍后使用这两个程序集实现其他指令,则将不需要这两个指令.

Of course, if you implement other instructions later using these two assemblies, you will not need these two instructions.

这篇关于Xamarin iOS-Firebase Analytics不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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