views:

9168

answers:

11

Recently, i have upgraded my iPhone SDK OS from version 2.2.1 to 3.0 version. After that while building my application i get an error the the provisioning profile has expired. So i created a new provisioning profile.

Then i made the distribution of my application with the provisioning profile. But i get an error in iTunes while syncing my application into iPhone device. The error message is "The application"iGVA " was not installed on the iPhone because the entitlements are not valid."

I checked the code signing Entitlements that contains the correct entitlement plist file.

Please suggest me to solve it out.

Any help would be appreciated !

  • Sathiya
A: 

I had this issue as well. As it turned out, sure I had edited a configuration to support ad hoc, and sure I was building using the distribution configuration. BUT. I hadn't edited the distribution configuration's properties, but the release's instead (I thought I was editing the distribution).

This might not be it. But even though you're certain, double check you're using the correct configuration, and that this configuration is adjusted properly.

quano
+6  A: 

I got bit by this as well. Found the answer here:

http://csm.tumblr.com/post/205415450/ad-hoc-apps-and-entitlements

You may need to make sure the path to your Entitlements.plist file is entered in your project settings under "Code Signing Entitlements".

Michael Pelz-Sherman
+20  A: 

Michael's answer above is spot on (or the link he points to is). Here are the steps I had to take to get it to work:

  • Have an ad-hoc certificate for which the device UDID is checked. Install that cert by dragging it onto the XCode icon.
  • On the project, create a distribution configuration and set your build params to the appropriate device | distribution. Right now, we build for Device 3.0 | Distribution.
  • My project did not include an Entitlements.plist file - I had to add it by selecting from the menu File | Add File | IPhone OS | Entitlements, and call the new file Entitlements.plist
  • The new plist file has only one row - set the value of that row to unchecked.
  • In the project build configuration, in the line for Code Signing Entitlements, enter the Entitlements.plist filename as the value.
  • In the Code Signing Identity, select the ad-hoc certificate identity (though I have found that you can also use your distribution certificate identity)
  • NOW BUILD :)
  • Deliver the resulting app file plus the ad-hoc cert to the person who gave you their UDID. Should work :).
Manuel Mattke
+1  A: 

I was getting crazy over this. Finally, I guess I got it. In project settings, I was setting entitlements and code signing stuff properly in the correct Adhoc configuration. However, although all seemed ok there, when I checked "Project -> Edit Active Target" my code signing entity was still stuck at "iPhone Developer".

After switching that to correct "iPhone Distribution", and recompiled Xcode asked me to allow code signing for the first time. And all compiled and transferred to my phone now!

Hope that helps. I seriously believe this problem is a bug/defect on Apple's side. I lost several hours for a simple thing, thanks to their undocumented ide..

Koray Balci
A: 

You also need to make sure that you have an unexpired provisioning profile, which foiled me on this one for a while (Ad Hoc provisioning profiles seem to expire after a year). Error message is the same, but it has nothing to do with not having a valid Entitlements.plist file.

mblackwell8
A: 

Hi,

I am facing the same error, the only problem is that my build is not an ad-hoc build, it's the usual Release configuration and just in case it wasn't obvious, I do not have an Entitlements.plist in my project.

So far I have verified the following:

  • The provisioning profile has the correct AppID
  • The provisioning profiles contains the device's UDID
  • The provisioning profile is valid, it's not expired

Also, I get this error only once, re-sycning works fine. Any ideas what might be going wrong?

--
Malik

malik
btw, it will also happen when you send out the wrong provisioning profile (as Duncan C said below) OR device is not included in the provisioning profile (even if you are not building ad hoc)
malik
A: 

Folks,

I just found another circumstance that causes this problem. You have to make sure you include the correct provisioning profile. I have an app that has both an iPhone/iPod version, and an iPad version built from the same project. I apparently sent out the iPad ad hoc profile with the iPad version of the app, and it doesn't work. Worse, I installed the correct profile locally with XCode, so everything works correctly on my machine.

Duncan C

Duncan C
+1  A: 

Be sure that when you 'Build and Archive' that you are building for 'Device' and your configuration is not 'Debug'. It will seem to create the archive correctly, but will fail upon installing the .ipa the device if you are set to a Debug profile when you do the 'Build and Archive'.

+2  A: 

An Entitlements.plist file is required for testers to install ad-hoc builds. The default iOS templates don't include one. In XCode 3.2.4 you create one like this:

  1. From the menu, choose "File > New File…"
  2. Under iOS Templates, there's a Code Signing section. Choose the certificate icon named Entitlements. Name the file "Entitlements.plist"
  3. Select Entitlements.plist in your source tree.
  4. Choose "View > Property List Type > iPhone Entitlements Plist"
  5. Add a new key to the property list (select the top line, press return)
  6. The item will probably be named "Can be debugged". If not, choose that from the available options. This is equivalent to "get-task-allow".

If you don't yet have one, create an 'ad-hoc' build profile:

  1. Select your target in the source tree.
  2. From the menu, choose "File > Get Info"
  3. In the inspector. select the "Build" tab.
  4. Under 'Configuration', choose "Edit Configurations…'
  5. Select your 'Release' configuration, click 'Duplicate' at the bottom of the screen.
  6. Rename the new configuration "Ad-Hoc Distribution"

Now you've created an Entitlements.plist, you need to add it to your build settings.

  1. Select your target in the source tree.
  2. From the menu, choose "File > Get Info"
  3. In the inspector. select the "Build" tab.
  4. Make sure the configuration selector is set to "Ad-Hoc Distribution"
  5. In the "Code Signing" group, change the value of "Code Signing Entitlements" to "Entitlements.plist" - XCode may have put in a relative path for you. If so, change it.

Note - you'll have errors installing the app on your own device if you build & run with "Code Signing Entitlements" set for other build configurations.

Finally, check that the Entitlements.plist has been added to your target.

  1. Select Entitlements.plist in the source tree.
  2. From the menu, choose "File > Get Info".
  3. Select the "Targets" tab.
  4. Make sure the checkbox next to your target is checked.

You should now be able to distribute your ad-hoc builds without this error.

Most of this was gleaned from Apple's Managing Application Entitlements Guide, the rest by trial & error.

mrwalker
A: 

This problem might not have anything to do with the Entitlements plist per se. I have two iPod Touches I use to test with. When I went to sync the apps with them, one worked perfectly, but for the other I got the 'entitlements are not valid' error. As it turns out, one device (the one that worked) had the mobile provision file on it, while the other one did not. This was an obvious oversight on my part. However, what threw me was I never explicitly added the provision file to the first device either. Not sure how it got onto that device (I'm still new at this - lol) - in the past I always just dragged it into the Organizer with the device attached, but I didn't do that this time.

So the provisioning profile and xcode were all set up perfectly with the correct IDs, etc. but the app still failed to sync. Obviously if the device isn't properly provisioned, you will get the error. Would be nice if the error was more helpful in this case.

DavidM