TobiasBuchholz / Plugin.Firebase

Wrapper around the native Android and iOS Firebase Xamarin SDKs
MIT License
211 stars 49 forks source link

Xamarin.iOS .net7 Plugin.Firebase.Core.Exceptions.FirebaseAuthException #290

Closed geogian98 closed 5 months ago

geogian98 commented 5 months ago

Hello! I had to port a native xamarin project from .net2 to .net7. On Android everything worked perfectly. On Ios I receive an exception when I try to: SignInAnonymouslyAsync. The exception message is: Plugin.Firebase.Core.Exceptions.FirebaseAuthException: An error occurred when accessing the keychain. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo dictionary will contain more information about the error encountered at Plugin.Firebase.Auth.FirebaseAuthImplementation.SignInAnonymouslyAsync()

I searched on Google and I tried everything, but the exception is still there.

I'm using Plugin.Firebase with version 2.0.13. In AppDelegate I'm calling CrossFirebase.Initialize(new CrossFirebaseSettings( true, true, false, false, false, false, false, true, true);)

I also included the googleService-info.plist as bundleResource. Is there something that I missed? How can I fix it? Thanks a lot!

TobiasBuchholz commented 5 months ago

Hey @geogian98, it would be great if you could share the solution of your problem so others facing the same issue in the future can benefit from it. Thanks! :)

geogian98 commented 5 months ago

@TobiasBuchholz I didn't find a solution. I was getting this error only on iphone simulator. On real device it was fine.

AdamEssenmacher commented 5 months ago

Thanks for the additional context, @geogian98

For anyone experiencing this in the future, I suspect this is a known oddity in the Firebase auth SDK affecting simulators only. If you have more than one app using the Firebase auth SDK on your simulator, the keychain gets weird about it and exceptions get thrown.

You can check if this is the case by trying a different simulator that hasn't had multiple apps installed on it.