Xamarin iOS - Firebase Analytics is not available

冷暖自知 提交于 2019-12-07 13:18:45

问题


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 is not available.

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

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?


回答1:


Resolved!

Firebase Analytics requires 3 references to work:

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

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

To work around this problem, I added in AppDelegate:

using Firebase.Analytics;
using Firebase.InstanceID;

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.



来源:https://stackoverflow.com/questions/46541722/xamarin-ios-firebase-analytics-is-not-available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!