Closed LittleCornerDev closed 3 years ago
I thought this issue might be related, but it seems to be for Android, and my issue is on iOS.
Looks like calling Firebase.Core.App.Configure(firebaseOptions);
earlier (before global::Xamarin.Forms.Forms.Init();
and LoadApplication(new App());
) fixed the issue.
Having the same issue and your fix doesnt seem to work for me :/
Hi!
Is there a good way to prevent running into a
System.TypeInitializationException
when initializing FirebaseAuth in Xamarin.Forms iOS?I have the Firebase initialization call (
Firebase.Core.App.Configure(firebaseOptions);
) right after loading the Xamarin Forms app (LoadApplication(new App());
) inAppDelegate.cs:FinishedLaunching()
.The app tries to do an automatic anonymous login (if saved login data not found). It loops and waits to make sure
CrossFirebaseAuth.Current
is not null first, but there seems to also be a delay forCrossFirebaseAuth.Current.Instance
?System.TypeInitializationException
is thrown when callingCrossFirebaseAuth.Current.Instance.SignInAnonymouslyAsync()
even ifCrossFirebaseAuth.Current
is not null. The exception also happens when just callingCrossFirebaseAuth.Current.GetInstance()
orvar instance = CrossFirebaseAuth.Current.Instance
.Is there something I'm missing? Please advise! š
Error Logged
p.s. Initialization and automatic login works fine on Android.
Device and OS iPhone 11, iOS 14.3
Nuget Versions Plugin.FirebaseAuth 4.1.0 Xamarin.Forms 5.0.0.19005