After setting up Firebase Analytics on both iOS and Android using DependencyService and then following the steps on this thread stackoverflow.com/questions/48774378/firebase-analytics-in-xamarin-forms to fix some bugs and using more supposed fixes on this one stackoverflow.com/questions/46541722/xamarin-ios-firebase-analytics-is-not-available , I'm still not able to setup Firebase on iOS.
It works fine on Android but on iOS the app just crashes while opening. This is the error I get:
[46244:5039010] *** Assertion failure in void _UIApplicationMainPreparations(int, char **, NSString *__strong, NSString *__strong)(), /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3698.54.4/UIApplication.m:3924
Here's the iOS AppDelegate code:
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); //XamForms.Controls.iOS.Calendar.Init(); Firebase.Analytics.Loader loader1 = new Firebase.Analytics.Loader(); Firebase.InstanceID.Loader loader2 = new Firebase.InstanceID.Loader(); Firebase.Core.App.Configure(); LoadApplication(new App()); return base.FinishedLaunching(app, options); }
Any idea of what I could be doing wrong? I can't even tell if it is a Forms, iOS or Nuget problem.
Answers
Have you added the
GoogleService-Info.plist
in your ios project?@LandLu yes I have with compilation action set to BundleResource