Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 11 Firebase auth for Mac app has error An error occurred when accessing the keychain

I am turning iOS app to Mac app, when I run Xcode for My Mac, I was trying to login my app on Mac, when I press button login, below Error shows:

An error occurred when accessing the keychain. The @c NSLocalizedFailureReasonErrorKey field in the @c NSError.userInfo dictionary will contain more information about the error encountered

MacOS: 10.15.1 Xcode: 11.2.1

It works totally fine on iPhone simulator or real iPhone, it only occurs when I try to run on Mac

I think this is a issue that Firebase does Auth does not really support Mac app that well.

PS: there is a question looks kind similar, but I don't really understand Firebase fails to configure and load the user on some devices running iOS 10

like image 555
Sky Avatar asked Dec 05 '25 16:12

Sky


1 Answers

Add Keychain Sharing Capability to the target's build settings. More context here.

Click the + Capability and then choose Keychain Sharing Capability

enter image description here

like image 62
Paul Beusterien Avatar answered Dec 07 '25 07:12

Paul Beusterien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!