views:

274

answers:

2

I followed Apple's instructions on how to create an Ad Hoc Distrubution bundle but I keep getting what appears to be a fatal Warning during the build process. As per the instructions, I set the signing identity to my distribution profile at the target (instead of the project), created my Entitlement.plist file and unchecked get-task-allow, linked this file to my target and run the build in distribution for device mode.

When I do that, the build completes successful but only after giving the following warning.

[WARN]CodeSign warning: entitlements are not applicable for product type 'Application' in SDK 'Device - iPhone OS 3.1.2'; ignoring...

The last step in the build is the CodeSign and I've noticed that although it ran without errors, it's missing the --entitlement command line option that is given on the official apple instruction guide.

Here is my CodeSign line

/usr/bin/codesign -f -s "iPhone Distribution: My Name" --resource-rules=/Volumes/Data/projects/xcode/MyAppName/build/Distribution-iphoneos/MyAppName.app/ResourceRules.plist /Volumes/Data/projects/xcode/MyAppName/build/Distribution-iphoneos/MyAppName.app

And here is apple's screen shot of what's expected.

here

Can someone please help me figure out if this is something I'm doing wrong because much to my dismay even the dev forum at apple has very little information on this CodeSign warning.

+1  A: 

I haven't read the official guide in quite some time, and don't really feel like finding it right now, but let's run through my checklist. I suspect your issue is around numbers 5-7.

  1. Requested a certificate for Ad Hoc distribution and it was approved.
  2. Created a provisioning profile for Ad Hoc distribution for the appropriate device IDs and App ID.
  3. Installed the certs and provisioning profile on your computer.
  4. Created a new "Ad Hoc" build configuration for your target (not required, but nice to keep things clean). This can be made by duplicating Release.
  5. Added an Entitlements.plist file to your target.
  6. Unchecked "get-task-allow" in the said Entitlements file.
  7. Entered the Entitlements.plist file name in the "Code Signing Entitlements" build setting in the Ad Hoc configuration.
  8. Chose the appropriate Ad Hoc provisioning profile in the "Any iPhone OS Device" under "Code Signing Identity" build setting in the Ad Hoc configuration.
  9. Build.

Well I think that's it. Did I miss anything?

Cory Kilger
Well, that sounds about right. The only thing I would change is for step 8, I actually set the "Any iPhone OS Device" item under "Code Signing Identity" to my distribution profile, instead of the "Code Signing Identity" itself. I'm really frustrated because I've already gone over these step three times end to end. I mean, I removed my public/private keys, removed my certificate, removed my provisioning profile and started over three times. I keep getting the same error.
A: 

Victory! I tried everything I could include reconstructing my project from scratch and I could not make this work. I upgraded to Xcode 3.2.2, opened the same project and did a build and it worked right away. I wish Apple would have slightly better documentation about what versions of xcode the instructions they have online are good for. Anyway, I hope that this will spare someone the anguish I had to go through the last couple of days.

That's odd. Those are the same steps I used with 3.2.1, but I'm glad it's working for you now. And it's always good to be up to date.
Cory Kilger
Hey Cory. I believe I had Xcode 3.1.2 because I hadn't upgraded since last Jan.