Keychain SecOSStatus Error: [- 34018]

I am having problems accessing Keychain on the device. This only happens when starting the application from Xcode. If I launch the application on my own (by clicking on its icon), Keychain works without problems. No problems in the 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 am using Xcode 6.1.1 and iPhone 5 with iOS 8.1.1.

It is worth noting that the application that I am trying to debug has code for accessing the keychain, which is located in the target line of the Cocoa Touch framework (this may be the source of the problem).

The provisioning profile is general: iOSTeam Provisioning Profile: * (managed by Xcode)

+5
source share
4 answers

Try disabling all breakpoints when starting the application from Xcode. You can enable them later.

+2
source

There are 2 ways to solve this problem .

  • Add permission file to your project. enter image description here

  • Securely add the folder subdirectory code to your target by signing the code.

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

enter image description here

+1
source

In the steps of building your goal, add a Run Script containing:

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

Example: adding a run script

I'm not sure why this is necessary, but it helped me overcome a very similar error.

0
source

An Xcode 8 error can also lead to this.

Github issue: KeychainAccess issue

0
source

Source: https://habr.com/ru/post/1212011/


All Articles