objective-c Xcode 5:代码签名权利错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18818381/
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
Xcode 5: Code signing entitlement errors
提问by Benjamin de Bos
I've build a new application which is going to support IOS 7. I got the new XCode 5 GM and tried to sign my apps using my fresh provisioning profile and distribution certificate, but i'm having trouble with distribution. I constantly get the following error:
我已经构建了一个将支持 IOS 7 的新应用程序。我获得了新的 XCode 5 GM 并尝试使用我的新配置文件和分发证书对我的应用程序进行签名,但我在分发时遇到了问题。我不断收到以下错误:
"Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. According to the provisioning profile, the bundle contains a key value that is not allowed: '[XXXX.com.sample.company ]' for the key 'keychain-access-groups".
“无效的代码签名权利。您的应用程序包签名中的权利与配置文件中包含的权利不匹配。根据配置文件,该包包含不允许的键值:'[XXXX.com.sample .company ]' 用于密钥“keychain-access-groups”。
Also the same error for a key value called application-identifier.
对于名为application-identifier.
Screenshot of the errror:
错误截图:


回答by Benjamin de Bos
The solution lies in the new option in Xcode 5 which says provisioning profile. Just set the project target's provisioning profile to the right one and it'll work.
解决方案在于 Xcode 5 中的新选项,它表示配置文件。只需将项目目标的配置文件设置为正确的配置文件即可。


回答by VGruenhagen
If you are like me and you think you tried EVERYTHING, archived your project over ten times, banged your head on the keyboard and still get this error. Please do yourself a favor and simply Restart XCode, it worked for me. Sometime Apple... I hate you.
如果你像我一样,你认为你尝试了一切,将你的项目存档十次以上,用你的头敲击键盘,但仍然出现这个错误。请帮个忙,只需重新启动 XCode,它对我有用。有时苹果...我恨你。
回答by Joe Regan
I went through many of the steps above but what finally worked for me was refreshing my profiles in Xcode. Not sure why it was necessary since my app's distribution profile was showing up in the list already. Here are the steps:
我经历了上面的许多步骤,但最终对我有用的是在 Xcode 中刷新我的配置文件。不知道为什么有必要,因为我的应用程序的分发配置文件已经出现在列表中。以下是步骤:
- Xcode Preferences
- Accounts tab
- Select your Apple ID
- Hit the View Details button in the Apple ID detail panel
- Hit the Refresh button in the lower left corner
- Xcode 首选项
- 帐户选项卡
- 选择您的 Apple ID
- 点击 Apple ID 详细信息面板中的查看详细信息按钮
- 点击左下角的刷新按钮
回答by novecapa
In my case, i activated the same capabilities in Xcode that in Application services in developer.apple.com. Thats works for me
就我而言,我在 Xcode 中激活了与 developer.apple.com 中的应用程序服务中相同的功能。那对我有用




回答by RickJansen
In my case (sorry) I switched "Team" to "None" in -> General -> Identity
就我而言(抱歉),我在 -> 常规 -> 身份中将“团队”切换为“无”
In another case I needed to switch this identity from "None" to the developer account managing the identities and profiles.
在另一种情况下,我需要将此身份从“无”切换到管理身份和配置文件的开发人员帐户。
Xcode sometimes messes up greatly with code signing, it seems. Or, we mere mortals simply aren't clever enough to understand what it is doing, of course. Don't give up, we're all going through some code signing torture at times!
看起来,Xcode 有时会在代码签名方面造成很大的麻烦。或者,我们这些凡人当然不够聪明,无法理解它在做什么。不要放弃,我们有时都在经历一些代码签名折磨!
回答by Beny Boariu
In my case, I had to set correct Provision Profile for Release, and then had to restart Xcode. Before restarting, it had same provision profile, and didn't work. So, sometimes a restart can do miracles. Maybe this helps somebody.
就我而言,我必须为 Release 设置正确的 Provision Profile,然后必须重新启动 Xcode。在重新启动之前,它具有相同的配置文件,并且不起作用。因此,有时重新启动可以创造奇迹。也许这对某人有帮助。
回答by beryllium
If someone uses a GameCenter then check this section in your target. I worked with some old project and there were 2 errors (but everything worked fine). Disabling and enabling it back solved this problem.
如果有人使用 GameCenter,请检查目标中的此部分。我与一些旧项目一起工作,有 2 个错误(但一切正常)。禁用并重新启用它解决了这个问题。
Most likely this action adds Game Center entitlement to App ID and and handle it itself.
很可能此操作将 Game Center 权利添加到 App ID 并自行处理。
回答by Vlad 25 WLD
1.Go to project folder, delete *.entitlements files. 2.Then go yo in xcode project target -> build settings -> code signing entitlements - delete values 3.Clean 4.Run
1.进入项目文件夹,删除*.entitlements文件。2.然后在xcode项目目标中去哟->构建设置->代码签名权利-删除值3.Clean 4.Run
回答by ColossalChris
Ah, this glorious error. For me whenever I see this error I check the following things:
啊,这个光荣的错误。对我而言,每当我看到此错误时,我都会检查以下事项:
1. Allow XCode to access your provisioning profile info all the time- If XCode keeps asking when you start it up to have access to your computer's private files so that it can get provisioning profile information with the options to allow access always, not now, or just one time - set it to ALWAYS ALLOW access
1. 允许 XCode始终访问您的配置文件信息- 如果 XCode 一直询问您何时启动它以访问您计算机的私人文件,以便它可以使用始终允许访问的选项获取配置文件信息,而不是现在,或仅一次 - 将其设置为始终允许访问
2. If you have any old entitlement files kicking around your project get rid of them and any sign of them- if you see a .entitlements file in your project delete it (or at least remove the reference to it if you aren't sure you are ready to outright delete it), then make sure the 'Code Signing Entitlements' line under the 'Code Signing' section in Build Settings is empty
2. 如果您的项目中有任何旧的权利文件,请删除它们以及它们的任何迹象- 如果您在项目中看到 .entitlements 文件,请删除它(如果您不确定,至少删除对它的引用)您已准备好彻底删除它),然后确保构建设置中“代码签名”部分下的“代码签名权利”行为空
3. Check your Application Services online and match them up with your Services in XCode for the app- Go to the Apple Member Center and check the App ID for your app, click on the app to see its 'Application Services' and see what you have checked, then go to XCode and check your 'Capabilities' section to make sure the two have the same list of Apple services on both
3. 在线检查您的应用程序服务并将它们与您在 XCode 中的应用程序服务相匹配- 前往 Apple 会员中心并检查您的应用程序的应用程序 ID,单击该应用程序以查看其“应用程序服务”并查看您的应用程序已检查,然后转到 XCode 并检查您的“功能”部分,以确保两者具有相同的 Apple 服务列表
4. Make sure you assign a valid Provisioning Profile to your app before validating- double check your provisioning profile for your app in the Apple Member Center, make sure it isn't expired, has the right App ID with the correct bundle id and distribution. Download and click on the new provisioning profile to make sure XCode has it, or go to XCode > Preferences > Accounts > click on your account and 'View Details' then click the bottom corner button to Sync all the profiles to XCode. You should have the profile available to select now in the 'Code Signing' section. Once you have the correct provisioning profile then you can set the 'Code Signing Identity' lines to the correct option for that provisioning profile.
4. 确保在验证之前为您的应用程序分配了有效的配置文件- 在 Apple 会员中心仔细检查您的应用程序的配置文件,确保它没有过期,具有正确的 App ID 和正确的捆绑包 ID 和分发. 下载并单击新的配置文件以确保 XCode 具有它,或转到 XCode > 首选项 > 帐户 > 单击您的帐户和“查看详细信息”,然后单击底角按钮将所有配置文件同步到 XCode。您现在应该可以在“代码签名”部分中选择配置文件。拥有正确的配置文件后,您可以将“代码签名身份”行设置为该配置文件的正确选项。
Note - if doing a distribution certificate it can help to set all the 'Code Signing Identity' lines to the identity you use for distribution including the debug lines
注意 - 如果进行分发证书,它可以帮助将所有“代码签名身份”行设置为您用于分发的身份,包括调试行
5. IF ALL ELSE FAILS - Clean your project and Restart XCode and some Apple magic may just work fine the next time you open your project and try to Validate
5. IF ALL ELSE FAILS - 清理你的项目并重新启动 XCode 和一些 Apple 魔法可能会在你下次打开你的项目并尝试验证时正常工作
回答by Brainware
My problem was solved by removing my Apple ID from Preferences->Accounts and then adding it back again. Then all my provisioning profile files showed up on the View Details utility panel. I was mistakenly choosing "Mac Team Provisioning Profile:*" instead of the actual distribution provisioning profile for the project thinking that it was a generic selection. Provisioning files must be specific to the project. Oh, and BTW, make sure your provisioning profile has the correct entitlements (for example, Maps). I managed to release an app with OSX Maps without the entitlement and Apple approved it -- but no Maps showed up on the production version!
通过从首选项-> 帐户中删除我的 Apple ID,然后重新添加它,我的问题得到了解决。然后我所有的配置文件都显示在 View Details 实用程序面板上。我错误地选择了“Mac Team Provisioning Profile:*”而不是项目的实际分发配置文件,认为这是一个通用选择。供应文件必须特定于项目。哦,顺便说一句,请确保您的配置文件具有正确的权限(例如,地图)。我设法在没有授权的情况下发布了一个带有 OSX Maps 的应用程序,Apple 批准了它——但没有 Maps 出现在生产版本中!

