The executable was signed with invalid entitlements
Solution 1
There are pretty good instructions in the 'Portal Program'. If you log into
http://developer.apple.com/iphone
Then click Distribution on the left, and click the
Creating and Downloading a Distribution Provisioning Profile for Ad Hoc Distribution
link at the bottom.
Here's the key bit:
For Ad Hoc Distribution, complete the following:
- In the File Menu, select New File -> iPhone OS -> Code Signing -> Entitlements. Name the file “Entitlements.plist" and click ‘Finish’. This creates a copy of the default entitlements file within the project.
- Select the new Entitlments.plist file and uncheck the “get-task-allow” property. Save the Entitlements.plist file. (in Xcode 4, get-task-allow is called "Can be debugged" )
- Select the Target and open the Build settings inspector. In the ‘Code Signing Entitlements’ build setting, type in the filename of the new Entitlements.plist file including the extension. There is no need to specify a path unless you have put the Entitlements.plist file somewhere other than the top level of the project.
- Click ‘Build’. (Note: Your binary must contain a flattened, square-image icon that is 57x57 pixels. This icon is displayed on the iPhone or iPod touch home screen.)
Solution 2
This error also may occur if you're trying to profile an app where the device is not included in the provisioning profile.
Make sure your device is included in the dev provisioning profile you want to use. Somehow the error message is misleading. My entitlements were actually ok.
Solution 3
I have found that "get-task-allow" needs to be checked for Development builds but unchecked for Distribution builds. The easiest way to accomplish this (AFAIK) is to have two entitlements files in your project: Entitlements.plist and EntitlementsDebug.plist - and to reference the proper one in the build project settings for the various configurations in your project.
Solution 4
Code signing entitlements are no longer necessary for Ad Hoc builds in Xcode 4 - see details notes in Apple Technical Note TN2250
Solution 5
If you once come into the situation, that checking "get-task-allow" seems to be required in order to deploy your debug (!) build to your phone, check this:
a) Check the build setting. There should be no entry in "Code Signing Entitlements" for Debug b) Remove Entitlements.plist temporarily and build your debug version. If it complains about a missing Entitlements.plist, then you probably have the same situation, I had to fight today. c) Build again with Entitlements.plist and enable "get-task-allow". If it works now, you probably have the same problem:
After messing around with new profiles I couldn't deploy my Debug build to the phone. AdHoc was fine. I checked a) - empty.. Hmm. I checked b) - complains. c) - worked...
After all I examined project.pbjproj in an editor and - although the GUI did claim, that there was no entry for "Code Signing Entitlements" in fact there was one in the Debug section. I emptied it and was done.
Admin
Updated on July 05, 2022Comments
-
Admin almost 2 years
I am having a problem with ad-hoc distribution on my iPhone. I have developed an application with SDK 3.0. I have a developer's license. I have added certificates and provisioning profiles in my project. So, no problem with that.
But, when I try to install the app on my iPhone, it compiles the project and then displays the error:
"The executable was signed with invalid entitlements"
in the Organizer window. Am I missing something? I have upgraded my iPhone from 2.2.1 and have downloaded latest SDK from Apple.Please help me with this issue.
-
SinisterMJ almost 15 yearsI was just going to write the same thing, it's easy to forget you need the get-tak-allow for ad-hoc in addition to store builds!
-
Simon Woodside over 14 yearsThat's odd, because I have Code Signing Entitlements under the Target settings in XCode 3.1.
-
Steve Weller over 14 yearsCode Signing Entitlements will appear if you make the Base SDK iPhone Device not Simulator in the target.
-
Joe Strout almost 14 yearsThis didn't work for me — it resulted in the same "invalid entitlements" error. But based on some comments below, I cleared everything, and then CHECKED (not unchecked) "get-task-allow", and tried again -- this time it worked.
-
TimM almost 14 yearsI had this same problem with an old project that I updated from git-hub, and checking that property (when I recall it was previously unset) also seemed to cure my issue as well. Strange.
-
JayCrossler almost 14 yearsWow, that just saved me about 12 hours of head-banging. Thanks.
-
smirkingman almost 14 yearsI have never needed to do this. For your development build configuration, just make sure that Code Signing Entitlements is blank.
-
WrightsCS over 13 yearsget-task-allow unchecked worked for me... what a sneaky little bastard
-
KevinDTimm over 13 yearsThanks for this, surprising how this stuff is so hard to find on Apple's site, it seems SO is a better resource.
-
memmons over 13 yearsI too had to check get-task-allow to get a developement build on my device.
-
thrusty about 13 yearsThis worked for me. After I added an Entitlements.plist for AdHoc, xcode copied that requirement to my Debug and Release targets (although I did not enter that in the Build tab). After removing from the pbxproj file by hand, the Debug build works again.
-
David Watson about 9 years@KevinDTimm Actually, it's not surprising. The documentation uses anchors very poorly and as a result, is not easily referenced by URI. That's why you see so many posts about provisioning and IOS on SO that describe going to a URI and then "click here, click there, click anywhere". I look forward to the day when Apple's documentation is not a walled garden.
-
Tobiaswk almost 9 yearsThis solved my problem. It was specifically the line
CODE_SIGN_IDENTITY = ...
that caused the problem. I have no idea when this was added by Xcode, or if I did it by mistake myself, but what a mess. Compared to other IDE's I have had so many weird problems with Xcode. I try to avoid it and stick to AppCode.