xcode 如何修复 iPhone 项目的“协同设计验证失败”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2879473/
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 fix "failed codesign verification" of an iPhone project?
提问by ohho
Last night, the iPhone project was built perfectly.
昨晚,iPhone项目完美搭建。
This morning, I installed XCode 3.2.3
in a separatefolder. When I open the same project in the old XCode 3.2.2
and re-built the project. I got this warning:
今天早上,我安装XCode 3.2.3
在一个单独的文件夹中。当我在旧的项目中打开同一个项目XCode 3.2.2
并重新构建该项目时。我收到了这个警告:
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)
应用程序未通过协同设计验证。签名无效,或未使用 Apple 提交证书签名。(-19011)
How can I fix it? Thanks!
我该如何解决?谢谢!
采纳答案by James J
I had the same problem, seems 3.2.3 messes with codesigning. I fixed it by re-running the 3.2.2 installer, no need to uninstall anything.
我有同样的问题,似乎 3.2.3 与代码设计混乱。我通过重新运行 3.2.2 安装程序修复了它,无需卸载任何东西。
回答by Dim
For me the following steps resolved the issue:
对我来说,以下步骤解决了这个问题:
Go to Product > Edit Scheme.
Open the Archive Profile.
Set Build configuration to Distribution.
转到产品 > 编辑方案。
打开存档配置文件。
将构建配置设置为分发。
回答by JJM
I've encountered the same problem too. It showed that I had a duplicate certificate registration in my keychains. Removing one of them (I removed the one from my system keychain) fixed the problem.
我也遇到过同样的问题。它表明我的钥匙串中有重复的证书注册。删除其中一个(我从系统钥匙串中删除了一个)解决了问题。
Steps that helped me to resolve my problem:
帮助我解决问题的步骤:
- Open KeyChain Access application
- Select the 'login' keychain, and select in the bottom pane 'Certificates'
- Switch to the 'system' keychain and see if there are certificates registered in both chains.
- Remove one of them
- Rebuild the application
- 打开钥匙串访问应用程序
- 选择“登录”钥匙串,然后在底部窗格中选择“证书”
- 切换到“系统”钥匙串,查看两个链中是否都注册了证书。
- 删除其中之一
- 重新构建应用程序
回答by tomwhipple
The parallel XCode problem can be addressed using the command line tool "xcode-select"
可以使用命令行工具“xcode-select”解决并行 XCode 问题
I found a similar problem caused by having XCode 4.2 beta installed. One of the embedded entitlements files was being placed in a different directory and was causing a file not found error.
我发现了由安装 XCode 4.2 beta 引起的类似问题。嵌入的权利文件之一被放置在不同的目录中,并导致文件未找到错误。
The solution was to use xcode-select to verify and fix the XCode path.
解决方案是使用 xcode-select 来验证和修复 XCode 路径。
回答by lumi77
Besides googling for possible solutions to this problem and trying them out (hoping that they help), here is an advice how to diagnose what causes this. The steps below apply to Xcode 4.2.
除了在谷歌上搜索这个问题的可能解决方案并尝试它们(希望它们有所帮助)之外,这里还有一个建议如何诊断导致这种情况的原因。以下步骤适用于 Xcode 4.2。
- In menu, select View > Navigators > Show Log Navigator. The Log Navigator should be displayed on the left side.
- In the list of builds, select the one that causes troubles. The log from the build will be shown in the main view.
- Scroll to the very bottom. The last two steps should be CodeSignand Validate, where the Validatestep contains the warning.
- Expand CodeSignand inspect the parameters used to perform the code signing.
- Expand Validateto learn more about the errors/warnings.
- 在菜单中,选择查看 > 导航器 > 显示日志导航器。日志导航器应显示在左侧。
- 在构建列表中,选择导致问题的构建。构建的日志将显示在主视图中。
- 滚动到最底部。最后两个步骤应该是CodeSign和Validate,其中Validate步骤包含警告。
- 展开CodeSign并检查用于执行代码签名的参数。
- 展开验证以了解有关错误/警告的更多信息。
Also scroll up and inspect the heading for the build target:
同时向上滚动并检查构建目标的标题:
Build Target (your build target)
构建目标(您的构建目标)
Project (your project) | Configuration (selected configuration) | Destination ...
项目(你的项目)| 配置(选择配置)| 目的地 ...
In my case, I found out that while doing the Archive build, the app was signed with the developer certificate. Inspecting the heading for the build target revealed that the Release configuration was used to build the archive. The remedy was to:
就我而言,我发现在进行存档构建时,应用程序已使用开发人员证书进行签名。检查构建目标的标题显示发布配置用于构建存档。补救措施是:
- In the menu, select Product > Edit Scheme
- In the Edit Scheme dialog, select the Archivebuild item (list on the left)
- Change Build Configurationto Distribution
- 在菜单中,选择产品 > 编辑方案
- 在 Edit Scheme 对话框中,选择Archive构建项(左侧列表)
- 将构建配置更改为分发
I had this issue after duplicating a build target. The original target was signed by the distribution certificate. However, when copying the target, Xcode decided to assign the Release configuration to the Archive build.
复制构建目标后我遇到了这个问题。原始目标由分发证书签名。但是,在复制目标时,Xcode 决定将 Release 配置分配给 Archive 构建。
回答by Arndt Bieberstein
Due to what hiroshi said you can change it there: I just do is:
由于 hiroshi 所说的,你可以在那里改变它:我只是做的是:
- Open the Organizer
- Go to Devices
- Provisioning Profile
- Click on the Profile you want to use. There you will see the profile identifier key.
- Open the xcode project via textfile (the file in the xcodepj bundle)
- Go to those lines and put the key in here
- 打开管理器
- 转到设备
- 配置文件
- 单击要使用的配置文件。在那里您将看到配置文件标识符键。
- 通过文本文件打开xcode项目(xcodepj包中的文件)
- 去那些行,把钥匙放在这里
@@ -325,6 +325,7 @@ PREBINDING = NO; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = "key goes here"; SDKROOT = iphoneos; @@ -361,6 +362,7 @@ PREBINDING = NO; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = "and also here"; SDKROOT = iphoneos;
@@ -325,6 +325,7 @@ PREBINDING = NO; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = "key goes here"; SDKROOT = iphoneos; @@ -361,6 +362,7 @@ PREBINDING = NO; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = "and also here"; SDKROOT = iphoneos;
- Save changes and restart the Project
- 保存更改并重新启动项目
!!!That's what worked for me in XCODE 4!!!
!!!这就是在 XCODE 4 中对我有用的东西!!!
回答by Merky
This is kind of an old post but I wanted to share what I learned (really remembered because I forgot this part.) I was trying to build my project against an ad-hock profile. I had forgotten that I needed to create a separate App Store profile (Provisioning Portal -> Provisioning -> Distribution). This was my first app I've submitted and the documentation is overwhelming so I missed/forgot about this part. Once I created the App Store profile and installed in XCode everything worked fine. Just wanted to throw this out there in case anyone else has this same issue.
这是一篇旧帖子,但我想分享我学到的东西(真的记得,因为我忘记了这部分。)我试图根据临时配置文件构建我的项目。我忘记了我需要创建一个单独的 App Store 配置文件(供应门户 -> 供应 -> 分发)。这是我提交的第一个应用程序,文档太多了,所以我错过了/忘记了这部分。一旦我创建了 App Store 配置文件并安装在 XCode 中,一切正常。只是想把它扔出去,以防其他人有同样的问题。
回答by Shaggy Frog
This happened to me today as I was moving an existing project into a new Git repository structure, while simultaneously using a development certificate obtained via being added to my client's team as a "Member". So lots of opportunity for things to screw up.
今天这件事发生在我身上,因为我正在将一个现有项目移动到一个新的 Git 存储库结构中,同时使用通过作为“成员”添加到我客户的团队中获得的开发证书。所以很多事情都有机会搞砸。
In my case, the issue turned out to be the "Build Products Path". I had it set to the relative path "../../../build" instead of an absolute path. This was causing the Validate tool to screw up since the actual path wasn't being collapsed properly. I changed it to an absolute path and the Validate tool then began to run successfully once more.
就我而言,问题原来是“构建产品路径”。我将它设置为相对路径“../../../build”而不是绝对路径。这导致验证工具搞砸了,因为实际路径没有正确折叠。我将其更改为绝对路径,然后验证工具再次开始成功运行。
I submitted this as a bug to Radar as #8946204.
我将此作为错误提交给 Radar,编号为 #8946204。
回答by hiroshi
I'm not sure, but reverting those changes in the project.pbxproj rescues me from failing to start my app in devices. The warning subject of the question remain though.
我不确定,但是恢复 project.pbxproj 中的这些更改可以使我免于无法在设备中启动我的应用程序。问题的警告主题仍然存在。
@@ -325,6 +325,7 @@
PREBINDING = NO;
+ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos;
@@ -361,6 +362,7 @@
PREBINDING = NO;
+ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos;
回答by Ben Williams
If you go to the Organizer and select Provisioning Profiles, is the profile listed there? If so, have you checked that it's setting in the Project Settings/Build/Code Signing section?
如果您转到管理器并选择配置配置文件,配置文件是否在那里列出?如果是这样,您是否检查过它在项目设置/构建/代码签名部分中的设置?