xcode iOS 8 测试版 OSStatus -34018 (errSecMissingEntitlement)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24652124/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iOS 8 beta OSStatus -34018 (errSecMissingEntitlement)
提问by Marcin
When I'm running in Simulator my application built in Xcode 6 / iOS SDK beta 3, SecItemCopyMatching function is returning -34018 error code (errSecMissingEntitlement).
当我在模拟器中运行我在 Xcode 6 / iOS SDK beta 3 中构建的应用程序时,SecItemCopyMatching 函数返回 -34018 错误代码 (errSecMissingEntitlement)。
OSStatus result = SecItemCopyMatching ((__bridge CFDictionaryRef)retrieveQueryDict, (CFTypeRef *)&dataRef);
I've noticed that problem in beta 1, then in beta 2 it was fixed. Furthermore, it was mentioned by Apple in the release notes as known issue of beta 1, fixed in beta 2. So far, so good. But then, in beta 3 this error occurs again, in the same exact place. But this time no explanation.
我在 beta 1 中注意到了这个问题,然后在 beta 2 中它被修复了。此外,Apple 在发行说明中提到它是 beta 1 的已知问题,已在 beta 2 中修复。到目前为止,一切都很好。但是,在 beta 3 中,此错误再次发生在同一个位置。但这次没有解释。
Anyone else has experienced that issue, or have some workaround? This should occur on Simulator only (at least that was the case with beta 1; at the moment I don't have a device to check), however for unit tests it's a blocker.
有没有其他人遇到过这个问题,或者有一些解决方法?这应该只发生在模拟器上(至少 beta 1 是这种情况;目前我没有要检查的设备),但是对于单元测试,它是一个阻止程序。
回答by dwsolberg
I had exactly the same scenario as you. I'm using SSKeychain, but it appears to be the same issue for everyone. Even though the release notes don't indicate it, the problem seems to in both iOS 8 beta 1 and in beta 3, skipping beta 2.
我和你的情况完全一样。我正在使用 SSKeychain,但对每个人来说似乎都是同样的问题。尽管发行说明没有指出这一点,但问题似乎在 iOS 8 beta 1 和 beta 3 中都存在,跳过了 beta 2。
The workaround I used is based off some answers to: SecItemAdd and SecItemCopyMatching returns error code -34018 (errSecMissingEntitlement)
我使用的解决方法基于以下问题的一些答案:SecItemAdd 和 SecItemCopyMatching 返回错误代码 -34018 (errSecMissingEntitlement)
Here's what worked for me: I signed into my developer account in Xcode 6, then enabled "Keychain Sharing" in the relevant project target's capabilities tab.
这对我有用:我在 Xcode 6 中登录了我的开发人员帐户,然后在相关项目目标的功能选项卡中启用了“钥匙串共享”。
回答by Dave Hirsch
I still had the problem with Keychain Sharing enabled, but now I have fixed this problem (I think). I had a wildcard provisioning profile on my device that showed it did not have a valid signing identity. I also had a provisioning profile for my app that was valid. When I deleted the wildcard profile, I stopped getting the -34018 errors.
我仍然有启用钥匙串共享的问题,但现在我已经解决了这个问题(我认为)。我的设备上有一个通配符配置文件,显示它没有有效的签名身份。我的应用程序还有一个有效的配置文件。当我删除通配符配置文件时,我不再收到 -34018 错误。
I also made sure that the code signing identity and provisioning profile listed in the Code Signing section of the Build Settings of the target were identical to the one for the app (not the generic "iPhone Developer" one)
我还确保目标构建设置的代码签名部分中列出的代码签名身份和配置文件与应用程序的相同(不是通用的“iPhone 开发人员”)
回答by Marcin
Fixed in beta 4. No info in the release notes though.
已在 beta 4 中修复。但发行说明中没有信息。