Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keychain SecOSStatusWith error:[-34018]

I'm having issues with accessing Keychain on a device. This happens only when the app is launched from Xcode. If I launch the app by myself (by tapping on its icon) the Keychain works without any problems. No issues in simulator either.

Console output:

Jan 27 14:33:24 iPhone MyApp[4305] <Error>:  SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn't be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
Jan 27 14:33:24 iPhone securityd[77] <Error>:  securityd_xpc_dictionary_handler MyApp[4305] delete The operation couldn’t be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements)

I'm using Xcode 6.1.1 and iPhone 5 with iOS 8.1.1.

It's worth noting that the app I'm trying to debug has the code for accessing keychain as located in a Cocoa Touch framework target (This could be the source of the problem).

The provisioning profile is a generic one: iOSTeam Provisioning Profile: * (Managed by Xcode)

like image 474
Tom Kraina Avatar asked Oct 20 '22 18:10

Tom Kraina


2 Answers

Try disabling all breakpoints when launching the app from Xcode. You can enable them afterwards.

like image 62
HeTzi Avatar answered Oct 22 '22 14:10

HeTzi


There are 2 ways you can resolve this issue.

  1. Add entitlement file to your project. enter image description here

  2. Forcefully add folder code signing to your target through code signing.

codesign --verify --force --sign "$CODE_SIGN_IDENTITY""$CODESIGNING_FOLDER_PATH"

enter image description here

like image 41
bllakjakk Avatar answered Oct 22 '22 13:10

bllakjakk