xcode 权利无效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1558642/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Entitlements are not valid
提问by Sathiya
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.
最近,我将我的 iPhone SDK OS 从 2.2.1 版升级到了 3.0 版。之后,在构建我的应用程序时,我收到一条错误消息,指出配置文件已过期。所以我创建了一个新的配置文件。
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."
然后我使用配置文件分发了我的应用程序。但是在将我的应用程序同步到 iPhone 设备时,我在 iTunes 中遇到错误。错误消息是“应用程序‘iGVA’未安装在 iPhone 上,因为权利无效。”
I checked the code signing Entitlements contains the correct entitlement plist
file.
我检查了代码签名权利包含正确的权利plist
文件。
How can this be solved?
如何解决这个问题?
回答by mmattke
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 :).
- 拥有已检查设备 UDID 的临时证书。通过将其拖到 XCode 图标上来安装该证书。
- 在项目上,创建分发配置并将构建参数设置为适当的设备 | 分配。现在,我们为设备 3.0 构建 | 分配。
- 我的项目不包含 Entitlements.plist 文件 - 我必须通过从菜单 File | 中选择来添加它。添加文件 | iPhone 操作系统 | 权利,并调用新文件 Entitlements.plist
- 新的 plist 文件只有一行 - 将该行的值设置为未选中。
- 在项目构建配置中,在 Code Signing Entitlements 行中,输入 Entitlements.plist 文件名作为值。
- 在代码签名标识中,选择临时证书标识(虽然我发现你也可以使用你的分发证书标识)
- 现在建立:)
- 将生成的应用程序文件和临时证书交付给向您提供 UDID 的人。应该管用 :)。
回答by Michael Pelz-Sherman
I got bit by this as well and found the answer in Ad-Hoc Apps and Entitlements.
我也对此有所了解,并在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".
您可能需要确保Entitlements.plist
在“代码签名权利”下的项目设置中输入了文件路径。
回答by mrwalker
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:
测试人员需要一个 Entitlements.plist 文件来安装临时构建。默认的 iOS 模板不包括一个。在 XCode 3.2.4 中,您可以像这样创建一个:
- From the menu, choose "File > New File…"
- Under iOS Templates, there's a Code Signing section. Choose the certificate icon named Entitlements. Name the file "Entitlements.plist"
- Select Entitlements.plist in your source tree.
- Choose "View > Property List Type > iPhone Entitlements Plist"
- Add a new key to the property list (select the top line, press return)
- The item will probably be named "Can be debugged". If not, choose that from the available options. This is equivalent to "get-task-allow".
- 从菜单中,选择“文件 > 新建文件...”
- 在 iOS 模板下,有一个代码签名部分。选择名为 Entitlements 的证书图标。将文件命名为“Entitlements.plist”
- 在源树中选择 Entitlements.plist。
- 选择“查看 > 属性列表类型 > iPhone 权利列表”
- 在属性列表中添加一个新键(选择第一行,按回车键)
- 该项目可能会被命名为“可以调试”。如果没有,请从可用选项中选择。这相当于“get-task-allow”。
If you don't yet have one, create an 'ad-hoc' build profile:
如果您还没有,请创建一个“临时”构建配置文件:
- Select your target in the source tree.
- From the menu, choose "File > Get Info"
- In the inspector. select the "Build" tab.
- Under 'Configuration', choose "Edit Configurations…'
- Select your 'Release' configuration, click 'Duplicate' at the bottom of the screen.
- Rename the new configuration "Ad-Hoc Distribution"
- 在源树中选择您的目标。
- 从菜单中选择“文件 > 获取信息”
- 在检查员。选择“构建”选项卡。
- 在“配置”下,选择“编辑配置...”
- 选择您的“发布”配置,点击屏幕底部的“复制”。
- 将新配置重命名为“Ad-Hoc Distribution”
Now you've created an Entitlements.plist, you need to add it to your build settings.
现在您已经创建了一个 Entitlements.plist,您需要将它添加到您的构建设置中。
- Select your target in the source tree.
- From the menu, choose "File > Get Info"
- In the inspector. select the "Build" tab.
- Make sure the configuration selector is set to "Ad-Hoc Distribution"
- 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.
- 在源树中选择您的目标。
- 从菜单中选择“文件 > 获取信息”
- 在检查员。选择“构建”选项卡。
- 确保配置选择器设置为“Ad-Hoc Distribution”
- 在“Code Signing”组中,将“Code Signing Entitlements”的值更改为“Entitlements.plist”——XCode可能已经为你放置了一个相对路径。如果是这样,请更改它。
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.
最后,检查 Entitlements.plist 是否已添加到您的目标中。
- Select Entitlements.plist in the source tree.
- From the menu, choose "File > Get Info".
- Select the "Targets" tab.
- Make sure the checkbox next to your target is checked.
- 在源树中选择 Entitlements.plist。
- 从菜单中,选择“文件 > 获取信息”。
- 选择“目标”选项卡。
- 确保选中目标旁边的复选框。
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.
其中大部分是从 Apple 的管理应用程序权利指南中收集的,其余的则是通过反复试验。
回答by Oded Ben Dov
For record's sake, as all these wonderful answers didn't help me, I thought I'd share my Entitlements glitch.
为了记录起见,由于所有这些精彩的答案都没有帮助我,我想我会分享我的权利故障。
So yes, I added UDIDs, got the provisioning, verified on the phone, in build settings, etc.
所以是的,我添加了 UDID,进行了配置,在手机上、构建设置中进行了验证等。
My glitch (thanks http://www.musicalgeometry.com/?p=1237) was that the Ad Hoc schemewas set as Ad Hoc configurationonly for the Run settings.
我的小故障(感谢http://www.musicalgeometry.com/?p=1237)是 Ad Hoc方案仅针对 Run settings设置为 Ad Hoc配置。
For archive settingsit was still pointing to the old Release configuration.
对于存档设置,它仍然指向旧的发布配置。
(These settings are the left side tabs in the edit scheme window.)
(这些设置是编辑方案窗口中的左侧选项卡。)
If I save someone my frustration - I've done my bit.
如果我拯救了某人我的挫败感 - 我已经尽了我的一份力量。
回答by snibbe
Code signing entitlements are no longer necessary for Ad Hoc builds in Xcode 4 - see details notes in Apple Technical Note TN2250
Xcode 4 中的 Ad Hoc 构建不再需要代码签名权利 - 请参阅Apple 技术说明 TN2250 中的详细说明
回答by mentat
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".
我快疯了。最后,我想我明白了。在项目设置中,我在正确的 Adhoc 配置中正确设置了权利和代码签名内容。然而,尽管那里一切看起来都不错,但当我检查“项目 - > 编辑活动目标”时,我的代码签名实体仍然停留在“iPhone 开发人员”。
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!
将其切换到正确的“iPhone 发行版”并重新编译后,Xcode 第一次要求我允许代码签名。现在全部编译并传输到我的手机!
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...
我希望这有帮助。我真的相信这个问题是苹果方面的错误或缺陷。由于他们未记录的 IDE,我为一件简单的事情浪费了几个小时...
回答by mblackwell8
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.
您还需要确保您有一个未过期的配置文件,这让我暂时无法使用这个配置文件(Ad Hoc 配置文件似乎在一年后过期)。错误消息是相同的,但它与没有有效的 Entitlements.plist 文件无关。
回答by cipherz
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'.
确保在为“设备”构建的“构建和存档”时,您的配置不是“调试”。它似乎可以正确创建存档,但如果在执行“构建和存档”时设置为调试配置文件,则在安装 .ipa 设备时将失败。
回答by Rob van Maris
I had this same problem, using Xcode 4. It turned out to be caused by a wrong selection for Identity in the "Share..." dialog in the (Archives section of the) Organizer. The correct selection (for me) is: "Don't Re-sign".
我在使用 Xcode 4 时遇到了同样的问题。结果是由于在管理器(的档案部分)的“共享...”对话框中选择了错误的身份造成的。正确的选择(对我来说)是:“不要重新签名”。
回答by DavidM
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.
这个问题可能与权利 plist 本身没有任何关系。我有两个 iPod Touch 用来测试。当我去与他们同步应用程序时,一个运行良好,但对于另一个我收到了“权利无效”错误。事实证明,一台设备(工作正常的)上有移动配置文件,而另一台没有。这显然是我的疏忽。然而,让我失望的是我也从未明确地将配置文件添加到第一个设备中。不知道它是如何进入该设备的(我还是个新手 - 哈哈) - 过去我总是将它拖到连接了设备的管理器中,但这次我没有这样做。
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.
因此,配置文件和 xcode 都使用正确的 ID 等进行了完美设置,但应用程序仍然无法同步。显然,如果设备未正确配置,您将收到错误消息。如果错误在这种情况下更有帮助,那就太好了。