Objective-c – “Executable was signed with invalid entitlements” when adding code signing entitlements

cocoa-touchiphoneobjective c

I am about to publish my first free app on the appstore. Following the instruction on the developer portal, I have added an "Entitlements.plist" file, and referenced this file in the "code signing entitlements" project setting. After I did this I can no longer test the app on my Ipod, with this error message "Executable was signed with invalid entitlements". If I remove the reference to the entitlements file, everything works fine.

I have already done this:
– re-downloaded my provisioning profile and installed it in organizer
– Tried making a new provisioning profile and installed that
– unchecked "get-task-allow" in the plist-file.
– Tried "clean all targets"

Can any of you shed any light on this one? Is this critical when publishing to the appstore? I have my distribution profile ready, but I suppose I have to solve this isssue first. I am thankful for any thoughts on this matter!

Best Answer

It sounds like you have accidentally set the project to use the entitlements file instead of just the distribution build. The entitlements file should not be used when compiling against your developer certificate ie for your iPod. It should only be used for distribution.

What you have most likely done is edit the global version of the setting (by double clicking on the project file in the groups and files section) instead of the target version.

Here is how to fix that.

  1. open your project in xcode
  2. under project set the active sdk and the active build configuration to whatever you use for your ipod
  3. open the target tab under groups and files
  4. Double click on the target you are trying to build. Target icons look like an A made out of tools
  5. scroll down to code signing and remove the code signing entitlements