An error occurred when accessing the keychain... iOS 10 simulator / Firebase Auth component

Programmer16Programmer16 USMember ✭✭

Hello all,

I've run into a troubling problem, and it seems to be when using the simulator and when using code that accesses the keychain.

I am trying to connect to my Firebase database with this code, but I receive the following error:

Auth.DefaultInstance.SignIn ("email", "pass", (user, error) => {
    if (error == null)
    {
        // logic
    }
});

"An error occurred when accessing the keychain. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo dictionary will contain more information about the error encountered"
"SecItemAdd (-34018)"

I am really stuck, and would like to ask the community what other things I should try.

Best Answer

  • Programmer16Programmer16 US ✭✭
    Accepted Answer

    I was able to install a previous version of xcode, and then run the simulator on iOS 9

Answers

  • Programmer16Programmer16 USMember ✭✭

    Bumping

  • moljacmoljac HRBeta ✭✭✭

    I bet this is iOS 10 simulator and device is OK and Release might be OK.

    If yes:

    1. Add empty Entitlements.plist to your project
    2. Add this Entitlements.plist to the build configs (Debug for sure, Release sometimes)
      go to Project Settings/Properties +/ Build +/ iOS Bundle Signing +/ Custom Entitlements
      make sure there is Entitlements.plist for Debug and Release

    Empty entitlements.plist

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    </dict>
    </plist>
    

    You can avoid that by not using iOS 10 simulators.

    It is actually Apple's bug (check apple's dev forums)

  • Programmer16Programmer16 USMember ✭✭

    Is it possible to run an older simulator?

  • Programmer16Programmer16 USMember ✭✭
    Accepted Answer

    I was able to install a previous version of xcode, and then run the simulator on iOS 9

Sign In or Register to comment.