4
votes

When I'm running in Simulator my application built in Xcode 6 / iOS SDK beta 3, SecItemCopyMatching function is returning -34018 error code (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.

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.

3

3 Answers

2
votes

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.

The workaround I used is based off some answers to: SecItemAdd and SecItemCopyMatching returns error code -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.

1
votes

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.

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)

0
votes

Fixed in beta 4. No info in the release notes though.