Entitlements are not valid

2019-01-08 09:39发布

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 that 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 synchronising my application into an 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 contains the correct entitlement plist file.

How can this be solved?

17条回答
孤傲高冷的网名
2楼-- · 2019-01-08 09:58

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 the correct "iPhone Distribution" and recompiled, Xcode asked me to allow code signing for the first time. And it all compiled and is transferred to my phone now!

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

查看更多
\"骚年 ilove
3楼-- · 2019-01-08 09:58

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.

查看更多
beautiful°
4楼-- · 2019-01-08 10:00

I experienced a problem whenever I added a new device in the device list, and then made the new profiles by selecting the new devices and drag them to Xcode and prepare the build.

The moment I use that build for device installation I get the error

ENTITLEMENTS ARE NOT VALID

I tried to resolve it by all the ways I could think of but nothing positive came out. Anyhow, I have to make the new App-ID or have to repeat the whole process of creating profiles. Then I can install the build on the device.

查看更多
做个烂人
5楼-- · 2019-01-08 10:02

This happened to me as well, and the other answers did not solve it for me.

After spending half a day building, installing, cleaning, clicking to no avail - I finally erased Entitlements.plist from the box under Code Signing Entitlements, saved, and typed it in again - voila! It worked again! I never touched the actual Entitlements file, just the setting.

查看更多
Fickle 薄情
6楼-- · 2019-01-08 10:03

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 :).
查看更多
老娘就宠你
7楼-- · 2019-01-08 10:03

I got bit by this as well and found the answer in 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".

查看更多
登录 后发表回答