Evgenii Evgenii - 1 month ago 87x
Swift Question

SecItemAdd always returns error -34018 in Xcode 8 Beta/GM in iOS 10 simulator

Why am I receiving error -34018 when calling


Steps to Reproduce

Create a new Single page iOS app project in Xcode 8 beta 4.
Run the following code in viewDidLoad (or open this Xcode project).

let itemKey = "My key"
let itemValue = "My secretive bee


I was able to work around this in my app by adding Keychain Access Groups to the Entitlements file. I turned on the Keychain Sharing switch in the Capabilities section in your test app, and it is working for me as well.

Screenshot of turning on the switch

Item to add to entitlements:


I have only tried this on macOS Sierra (10.12), so I'm not sure if it will work for you on 10.11.5.