ort11
ort11

Reputation: 3349

iOS App Today Widget App Group Entitlement with Keychain Sharing Entitlement, Error on Device like Simulator -25243 (errSecNoAccessForItem)

Have an application that has been using Keychain Access for a bit and working fine.

Added a Today Widget and then added the App Group Entitlement.

All seems to be good, but now getting

CRASH: Couldn't add the Keychain Item Error
Domain=NSOSStatusErrorDomain Code=-25243
"The operation couldn’t be completed. (OSStatus error -25243.)".

When trying to use the keychain.

This is on a DEVICE and not in the simulator.

Using device because of testing with Push Notifications.

Have tried cleaning, updating profiles, etc.

XCode 6.3.1 Mini iPad iOS 8.3

Upvotes: 3

Views: 1942

Answers (1)

Razvan
Razvan

Reputation: 4122

The error -25243 is often caused by trying to access a keychain access group for which you don't have permissions because they might be missing from your Entitlements.plist file or your provisioning profile.

So you should do the following:

  1. Check that you have your entitlements file in your project.
  2. Try disabling/enabling entitlements.
  3. Check that your app id has the required permissions enabled and that your provisioning profile(s) which you use with your build schema when you run the app on the devices have been regenerated with the new permissions/entitlements.

If everything is OK after checking up the above steps, my two cents would be that the provisioning profile that you use for your debug schema which you use to build the app to run on the device does not contain the required entitlements.

Edit: 4. According to the OP, one should also check if the value item for com.apple.security.application-groups in the entitlements file matches.

Upvotes: 1

Related Questions