views:

18587

answers:

7

hi all

I am having a problem with ad-hoc distribution in iPhone. I have developed an application in sdk 3.0. I have 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 error "The executable was signed with invalid entitlements" on Organizer window. Am I missing something..? I have upgraded my iphone from 2.2.1 and have downloaded latest sdk from apple site.

Plz help me with this issue..

+26  A: 

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.
  • 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.)
John
I 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!
Kendall Helmstetter Gelner
Many thanks! Solved my problem exactly!
casademora
This 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.
Joe Strout
I 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.
TimM
Wow, that just saved me about 12 hours of head-banging. Thanks.
JayCrossler
Thanks for this, surprising how this stuff is so hard to find on Apple's site, it seems SO is a better resource.
KevinDTimm
+1  A: 

hi John thanx for your answer.. my problem is solved but still not sure what was actually wrong...

I added Entitlements.plist as you had suggested, unchecked the “get-task-allow” property, but it was not working... Then i removed all the certificates from project... downloaded again from apple site.. added them into project and voila it was working... however I had to "check" the get-task-allow property in order to remove the error... so not sure what the problem was but thanx for your quick help...

No prob - I have also noticed the GUI doesn't always actually update in Xcode, especially in Interface Builder. (eg change a font or color but it doesn't "take")
John
A: 

John's answer is 99% correct. I found that (at least in my configuration), you have to open the Build settings inspector for the PROJECT. The build settings for the target do not contain "Code Signing Entitlements". Perhaps this doesn't make a difference if you have only one target in your project. But if you have multiple targets, you need to go to the project build settings. In any case, after doing what John said, my ad-hoc distribution build worked perfectly.

iisystems
That's odd, because I have Code Signing Entitlements under the Target settings in XCode 3.1.
sbwoodside
Code Signing Entitlements will appear if you make the Base SDK iPhone Device not Simulator in the target.
Steve Weller
A: 

I had the same problem trying to install the app with x-code. The development certificate works fine, but the distribution ad-hoc does not unless I check "get-task-allow". So is there something else wrong? What does "get-task-allow" do?

Brain2000
This is not a forum. If you have a new question, click the Ask a Question button.
vash47
+9  A: 

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.

gumbypp
I have *never* needed to do this. For your development build configuration, just make sure that Code Signing Entitlements is blank.
Ben Scheirman
get-task-allow unchecked worked for me... what a sneaky little bastard
AWright4911
I too had to check get-task-allow to get a developement build on my device.
Harkonian
A: 

Nice anwer John, thank you so much.

franco
A: 

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.

neil