“访问钥匙串时发生错误”当使用Firebase登录时 [英] "An error occurred while accessing the keychain" when signing in using Firebase

查看:165
本文介绍了“访问钥匙串时发生错误”当使用Firebase登录时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:

我正在使用Firebase进行应用登录。
我正在使用通过电子邮件地址功能登录。
开始使用新的xCode测试版并将代码更新到Swift 3之后,错误就开始了


你可以在这里看到这个问题的原型: https://bitbucket.org/gilosborne/firebasetest



错误:

当我尝试登录时,出现访问钥匙串时发生错误的错误。



我没有以任何方式使用Apple Keychain,我相信这里指的是keychain的提及: https://firebase.google.com/docs/auth/ios/errors



当我输入错误的电子邮件地址时,我得到正确的错误说电子邮件地址不匹配。而创建一个新的帐户仍然有效。我只有在正确登录现有电子邮件地址时才会出现错误。

在查看上面的firebase文档后,我打印了以下内容:
print(error?.userInfo [NSLocalizedFailureReasonErrorKey])



更多,并得到这些控制台日志



可选(SecItemAdd(-34018))


$ b $ n



我对iOS开发非常陌生,但是我花了好几个小时或者Google搜寻,试图解决这个问题,并取得了零进展。

再说一次,一切正常。我所做的只是更新到Swift 3.0,这开始发生。任何帮助真的很棒,谢谢!



ps。对不起,如果我错过了任何东西,这是我第一次发布。

解决方案

尝试开启项目功能中的钥匙串共享目标。为我工作。
钥匙串分享


Background:

I'm using Firebase for my apps login. I am using the login via email address functionality. The error started after starting to use the new xCode beta and updating the code to Swift 3

You can see a prototype of the problem here: https://bitbucket.org/gilosborne/firebasetest

The error:

When I try to log in I get the error, "An error occurred while accessing the keychain".

I am not using Apple keychain in any way, I believe it is referring to the mentions of keychain here: https://firebase.google.com/docs/auth/ios/errors

When I enter the email address wrong i get the correct error saying the email address doesn't match. And creating a new account still works also. I only get the error when login in correctly with an existing email address.

After looking into the firebase documentation above more I printed: print(error?.userInfo[NSLocalizedFailureReasonErrorKey])

and

print(error?.userInfo[NSUnderlyingErrorKey])

to try and learn more and got these console logs

Optional(SecItemAdd (-34018))

nil

I'm very new to iOS development, but I have spent hours or googling and racking my brain trying to fix this and have made zero progress.

Again, everything was working just fine. All I did was updated to Swift 3.0 and this started happening. Any help would be really awesome, thank you!

ps. Sorry if I missed anything, this is my first time posting.

解决方案

Try turning on the Keychain Sharing in Capabilities of your projects' target. that worked for me. Keychain Sharing

这篇关于“访问钥匙串时发生错误”当使用Firebase登录时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆