xcode 上传到 iTunes Connect 时如何解决“应用程序协同设计验证失败”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2272863/
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
How to solve "Application failed codesign verification" when uploading to iTunes Connect?
提问by Cy.
I've got a problem that I couldn't solve with a deep search in different resources as most of the "similar" points out to be an error with Icon.png size, etc...
我有一个问题,我无法通过在不同资源中进行深入搜索来解决,因为大多数“类似”指出是 Icon.png 大小的错误,等等......
I've tried to upload my application after verifying that:
我尝试在验证后上传我的应用程序:
- Correctly builds and run on my device
- That my certificates are installed properly
- That my certs / profiles are not expired.
- That the Icon.png has the proper size and format of 57x57 PNG.
- And several other things.
- Ran codesign --verify -vvvv MyApp.app which worked fine.
- My ZIP File was properly done
- 在我的设备上正确构建和运行
- 我的证书安装正确
- 我的证书/配置文件没有过期。
- Icon.png 具有 57x57 PNG 的正确大小和格式。
- 还有其他几件事。
- Ran codesign --verify -vvvv MyApp.app 运行良好。
- 我的 ZIP 文件已正确完成
When I've tried to upload through the iTunes connect interface I got the simple error above, and that's why I tried with ApplicationLoader, to try and find out what's causing the error looking at the console.
当我尝试通过 iTunes 连接界面上传时,我遇到了上面的简单错误,这就是我尝试使用 ApplicationLoader 的原因,试图找出导致查看控制台错误的原因。
The console showed the following:
控制台显示以下内容:
16/02/10 13:25:52 ApplicationLoader[549] *** Codesign error (please ignore invalid option comments): got requirements(0x800000, 534)
Executable=/var/folders/WZ/WZu24JnOGNe9L79GWq0IlU+++TI/-Tmp-/MyApp.zip/MyApp.app/MyApp
Identifier=com.realtimed.MyApp
Format=bundle with Mach-O thin (armv6)
CodeDirectory v=20100 size=829 flags=0x0(none) hashes=33+5 location=embedded
Signature size=4333
Authority=iPhone Developer: My Name (XXXXXXXXX)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=16/02/2010 13:22:24
Info.plist entries=17
Sealed Resources rules=3 files=28
Internal requirements count=1 size=144
Executable=/var/folders/WZ/WZu24JnOGNe9L79GWq0IlU+++TI/-Tmp-/MyApp.zip/MyApp.app/MyApp
got entitlements(0x800400, 317)
codesign_wrapper-0.7.3: using Apple CA for profile evaluation
codesign_wrapper-0.7.3: Caling codesign with the following args:
codesign_wrapper-0.7.3: /usr/bin/codesign
codesign_wrapper-0.7.3: --verify
codesign_wrapper-0.7.3: -vvvv
codesign_wrapper-0.7.3: -R=anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.1] exists and certificate leaf[field.1.2.840.113635.100.6.1.4] exists
codesign_wrapper-0.7.3: --entitlements
codesign_wrapper-0.7.3: /var/tmp/signingbox/codesign_wrapper_entitlements.plist
codesign_wrapper-0.7.3: /var/folders/WZ/WZu24JnOGNe9L79GWq0IlU+++TI/-Tmp-/MyApp.zip/MyApp.app
**/var/folders/WZ/WZu24JnOGNe9L79GWq0IlU+++TI/-Tmp-/MyApp.zip/MyApp.app: valid on disk
/var/folders/WZ/WZu24JnOGNe9L79GWq0IlU+++TI/-Tmp-/MyApp.zip/MyApp.app: satisfies its Designated Requirement
test-requirement: failed to satisfy code requirement(s)
codesign_wrapper-0.7.3: failed to execute codesign(1)**
Any help / feedback or ideas on how to solve the situation would be highly appreciated.
任何有关如何解决这种情况的帮助/反馈或想法将不胜感激。
回答by Cy.
I found the solution to this problem after deeply looking at the log file.
在深入查看日志文件后,我找到了解决此问题的方法。
Although I created my own Distribution Profile and assigned to the CODE SIGNING IDENTITY the correct value for the developer certificate, it didn't work giving me an error: "Application failed codesign verification".
尽管我创建了自己的分发配置文件并将开发人员证书的正确值分配给了代码签名标识,但它不起作用并给我一个错误:“应用程序未能通过代码验证”。
The problem is at the following line:
问题出在以下行:
Authority=iPhone Developer: My Name (XXXXXXXXX)
权限=iPhone 开发者:我的名字 (XXXXXXXXX)
Despite the correct selection in the project settings for the Distribution profile, XCode was compiling it with the developer certificate.
尽管在分发配置文件的项目设置中选择正确,但 XCode 正在使用开发人员证书对其进行编译。
I finally solved it: Right click on the "Targets" -> Get info -> and there it was selected (don't ask me why) the wrong distribution certificate instead of the right one.
我终于解决了它:右键单击“目标”-> 获取信息-> 并在那里选择了(不要问我为什么)错误的分发证书而不是正确的分发证书。
I corrected that and it finally was accepted.
我纠正了它,它终于被接受了。
Related links (you need a developer account):https://devforums.apple.com/message/147964
相关链接(需要开发者账号):https : //devforums.apple.com/message/147964
回答by Old McStopher
Excellent post. I too was having this trouble and after much headache realized that both the Project AND the Target should be checked for using the correct Code Signing Identity. Somehow Xcode was reverting back to the Developer Provisioning Profile instead of the DistributionProvisioning Profile. It even did so on a build right after I had deliberately selected the correct one!
优秀的帖子。我也遇到了这个问题,在头疼之后意识到应该检查项目和目标是否使用正确的代码签名身份。不知何故,Xcode 恢复到 Developer Provisioning Profile 而不是DistributionProvisioning Profile。它甚至在我特意选择了正确的构建之后就这样做了!
I. To be safe, first do the following:
一、为了安全起见,首先要做到以下几点:
- Clean all builds.
- Delete contents of build folder in finder.
- Delete existing code signing identities from the project and target settings.
- Restart Xcode.
- 清理所有构建。
- 删除 finder 中 build 文件夹的内容。
- 从项目和目标设置中删除现有的代码签名身份。
- 重新启动Xcode。
II. Then check the Project for the correct Provisioning Profile:
二、然后检查项目以获取正确的配置文件:
- Go to
Project Settings > Build Tab > Code Signing Identity
- Select the appropriate Distribution Provisioning Profile
- 去
Project Settings > Build Tab > Code Signing Identity
- 选择合适的分发配置文件
III. Now check the Target:
三、现在检查目标:
Target > Get Info > Build Tab > Code Signing Identity
- Select the appropriate Distribution Provisioning Profile
Target > Get Info > Build Tab > Code Signing Identity
- 选择合适的分发配置文件
IV. Cross fingers and hope you never see that blasted little yellow triangle again.
四、交叉手指,希望你再也看不到那个该死的小黄色三角形。
回答by Bobjt
Cy took the right approach for solving this problem - When "Application failed codesign verification"is a build warning, expand that item in the build log and scan for the root causeof the failed signature verification.
Cy 采取了正确的方法来解决这个问题 - 当“Application failed codesign verify”是一个构建警告时,在构建日志中展开该项目并扫描签名验证失败的根本原因。
In the case of Cy.'s original post you'll see that the root issue was "test-requirement: failed to satisfy code requirement(s)", and in my experience this is almost always caused by signing with the wrong certificate i.e. an iPhone Developer profile instead of iPhone Distribution.
在 Cy. 的原始帖子的情况下,您会看到根本问题是“测试要求:未能满足代码要求”,根据我的经验,这几乎总是由使用错误的证书签名引起的,即iPhone 开发人员配置文件而不是 iPhone 分发版。
The root cause is not always an obvious explanation, but should guide you at least with additional search terms or troubleshooting ideas.
根本原因并不总是一个明显的解释,但至少应该通过其他搜索词或故障排除想法来指导您。
For others experiencing the "Application failed codesign verification"during Xcode Archive Validation or Submission, look to the build log at Product > Archive time for a build warning by the same title and expand that for the root cause. Then take a look at Apple's complete list of potential causes of this error at the following URL "How do I resolve the error: Application failed codesign verification?"
对于在 Xcode 存档验证或提交期间遇到“应用程序协同设计验证失败”的其他人,请查看产品 > 存档时间的构建日志,以获取具有相同标题的构建警告,并针对根本原因展开该警告。然后在以下 URL 中查看 Apple 完整的此错误潜在原因列表“我如何解决错误:应用程序未能通过协同设计验证?”
回答by Lucas
Check that the TARGET (and not only the Project) is setup with the correct Code Signing Identity for Release
检查目标(不仅是项目)是否设置了正确的代码签名标识以供发布