xcode 应用程序未通过协同设计验证。签名无效,包含不允许的权利,或未使用分发签名
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12455072/
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
Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with a Distribution
提问by davids
I'm trying to push an iOS application to iTunes Connect, but I get this error when I try to validate it in Xcode:
我正在尝试将 iOS 应用程序推送到 iTunes Connect,但是当我尝试在 Xcode 中对其进行验证时出现此错误:
Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate
I've seen loads of questions related to the same issue, but those didn't work for me. I follow every single step of Apple's Technical Note TN2250. I check that in the build settings a distribution profile is selected for release (have tried with the wildcard and a custom one for the app) and the schema is the correct one. To ensure the app was signed with that profile, I use the codesign -d -vvvv MyApp.app
command, and get something like:
我已经看到很多与同一问题相关的问题,但这些问题对我不起作用。我遵循 Apple技术说明 TN2250 的每一步。我检查在构建设置中是否选择了发布配置文件(已尝试使用通配符和应用程序的自定义配置文件)并且架构是正确的。为确保应用程序已使用该配置文件进行签名,我使用该codesign -d -vvvv MyApp.app
命令,并得到如下内容:
Executable=/Users/myuser/Library/Developer/Xcode/Archives/2012-09-17/myapp 17-09-12 09.27.xcarchive/Products/Applications/MyApp.app/MyApp
Identifier=com.example.MyApp
...
Authority=iPhone Distribution: My Company
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
...
I check the entitlements, which I haven't modified, with security cms -D -i MyApp.app/embedded.mobileprovision
, getting this:
我检查了我没有修改的权利security cms -D -i MyApp.app/embedded.mobileprovision
,得到这个:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ApplicationIdentifierPrefix</key>
<array>
<string>PR3F1X</string>
</array>
<key>CreationDate</key>
<date>2012-09-17T07:20:35Z</date>
<key>DeveloperCertificates</key>
<array>
<data>
...
</data>
</array>
<key>Entitlements</key>
<dict>
<key>application-identifier</key>
<string>PR3F1X.com.example.MyApp</string>
<key>get-task-allow</key>
<false/>
<key>keychain-access-groups</key>
<array>
<string>PR3F1X.*</string>
</array>
</dict>
<key>ExpirationDate</key>
<date>2013-09-16T07:20:35Z</date>
<key>Name</key>
<string>PROFILE NAME</string>
<key>TeamIdentifier</key>
<array>
<string>PR3F1X</string>
</array>
<key>TimeToLive</key>
<integer>364</integer>
<key>UUID</key>
<string>...</string>
<key>Version</key>
<integer>1</integer>
</dict>
</plist>
The bundle id of this app looks like com.example.MyApp, and I thought the upper cases could be the problem, but changed them and it didn't do. After that, I revoked my certificates, got fresh mobileprovision profiles and went through the whole process again, with no success.
这个应用程序的包 id 看起来像 com.example.MyApp,我认为大写字母可能是问题所在,但更改了它们并没有这样做。之后,我撤销了我的证书,获取了新的 mobileprovision 配置文件,并再次完成了整个过程,但没有成功。
The software I'm using is Xcode 4.3.2 with Mac OS X 10.7.4
我使用的软件是 Xcode 4.3.2 和 Mac OS X 10.7.4
I can't see where the problem is, I'm missing something.
我看不出问题出在哪里,我错过了一些东西。
EDIT 1: Does modifying the bundle ID requires I change some other setting manually?
编辑 1:修改捆绑 ID 是否需要我手动更改一些其他设置?
EDIT 2: I just made a sample app from scratch, signed it with the same certificates and everything goes smooth, so it seems that the problem is in the configuration. I'm trying to see the differences between those two project's settings, but the only remarkable ones would be that the first one is iPad only and it uses a couple of PhoneGap plugins.
编辑 2:我刚刚从头开始制作了一个示例应用程序,使用相同的证书对其进行签名,一切都很顺利,所以问题似乎出在配置上。我正在尝试查看这两个项目设置之间的差异,但唯一值得注意的是第一个仅适用于 iPad,并且它使用了几个 PhoneGap 插件。
回答by Alexander
I had the same problem. You had to check your Application's Signature, see How do I check the entitlements on my Application's Signaturewith following:
我有同样的问题。您必须检查您的应用程序签名,请参阅如何检查我的应用程序签名上的权利,如下所示:
codesign -d --entitlements - /path/to/MyGreatApp.app
codesign -d --entitlements - /path/to/MyGreatApp.app
It's OK
and I don't know what the error you have, if you get something like:
这是OK
我不知道你有什么错误,如果你喜欢的东西:
Executable=/path/to/MyGreatApp.app/MyGreatApp
??qq?<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>ABC123DE45.com.appleseedinc.mygreatapp</string>
<key>get-task-allow</key>
<false/>
<key>keychain-access-groups</key>
<array>
<string>ABC123DE45.com.appleseedinc.mygreatapp</string>
</array>
</dict>
</plist>
But If you get only:
但如果你只得到:
Executable=/path/to/MyGreatApp.app/MyGreatApp
Executable=/path/to/MyGreatApp.app/MyGreatApp
Then, it's a problem. Probably, you damaged the entitlements during the code resigning with codesign
tool.
那么,问题来了。可能是您在使用codesign
工具辞职的代码期间损坏了权利。
I've made next steps to fix it:
我已经采取了后续步骤来修复它:
- Archive any app in Xcode.
- Choose 'Distribute ...'->'Save for Enterprise Ad-Hoc Deployment' as AppName.ipa
- Unzip AppName.ipa
- Create Application's Signature entitlements file: codesign -d --entitlements :enterprise.plist Payload/PathToApp.app/
- Go to the folder where uploaded app located.
Create Provisioning profile entitlements file:
security cms -D -i /path/to/the.app/embedded.mobileprovision > provision_entitlements.plist
Open provision_entitlements.plist and enterprise.plist. Modify settings of enterprise.plist , it should be equal to provision_entitlements.plist->Entitlements property. Save the changes.
When resign the app add argument --entitlements enterprise.plist to codesign tool.
codesign -fs "iPhone Distribution: My Company" APP_DIRECTORY --entitlements enterprise.plist
- 在 Xcode 中存档任何应用程序。
- 选择“分发...”->“保存用于企业临时部署”作为 AppName.ipa
- 解压 AppName.ipa
- 创建应用程序的签名权利文件: codesign -d --entitlements :enterprise.plist Payload/PathToApp.app/
- 转到上传的应用程序所在的文件夹。
创建供应配置文件权利文件:
security cms -D -i /path/to/the.app/embedded.mobileprovision > provision_entitlements.plist
打开provision_entitlements.plist 和enterprise.plist。修改enterprise.plist的设置,它应该等于provision_entitlements.plist->Entitlements属性。保存更改。
退出应用程序时,将参数 --entitlements enterprise.plist 添加到协同设计工具。
codesign -fs "iPhone Distribution: My Company" APP_DIRECTORY --entitlements enterprise.plist