Xcode 说找不到代码签名身份
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25877084/
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 says No code signing identities found
提问by Stack This High
In Xcode, when I try to Build an existing app, I get an error: "Code Sign Error: No codesigning identities found:..."
在 Xcode 中,当我尝试构建现有应用程序时,出现错误:“代码签名错误:未找到代码签名身份:...”
In the app's Build Settings, I have selected the Provisioning Profile for the app, but in Code Signing Identity the only thing I can get is "iPhone Developer". When I click on that, the popup also tells me "No Identities from Profile "..."".
在应用程序的构建设置中,我为应用程序选择了配置文件,但在代码签名标识中,我唯一能得到的是“iPhone 开发人员”。当我点击它时,弹出窗口还会告诉我“没有来自个人资料“...”的身份。
So apparently there's something wrong with the Provisioning Profile or identity.
很明显,配置文件或身份有问题。
When I edit the Provisioning Profile, I am only given three options, all of them are identities with the same name and various dates. I chose the one with the latest expiration date.
当我编辑 Provisioning Profile 时,我只得到三个选项,它们都是具有相同名称和不同日期的身份。我选择了最晚到期日期的那个。
I tried deleting the Profile and certificate from my library and Keychain, then downloaded them and double-clicked on the files to reinstall them. No change.
我尝试从我的库和钥匙串中删除配置文件和证书,然后下载它们并双击文件重新安装它们。没变。
I do see that Keychain Access is not showing the triangle next to my certificate, but I'm not being offered a private key at any point.
我确实看到 Keychain Access 没有在我的证书旁边显示三角形,但在任何时候都没有向我提供私钥。
In Developer Member Center, in iOS Certificates (Production), I did try clicking on the + icon to create a new certificate, but the option to create an App Store certificate is greyed out. I can't tell if the existing certificates are for the App Store... clicking on them only gives me the option to Revoke or Download.
在 Developer Member Center 的 iOS Certificates (Production) 中,我确实尝试单击 + 图标来创建新证书,但是创建 App Store 证书的选项是灰色的。我不知道现有证书是否适用于 App Store...单击它们只会让我选择撤销或下载。
Apparently I somehow need to get a private key, but I'm not seeing a way to retrieve nor create one. The Member Center is not telling me if I've encountered a three-certificate limit or something, nor whether revoking something will interfere with what is in the App Store... not that a revocation seems needed, as I'm trying to add and not interfere with other developers.
显然,我以某种方式需要获取私钥,但我没有看到检索或创建私钥的方法。会员中心没有告诉我我是否遇到了三个证书的限制或其他问题,也没有告诉我撤销某些内容是否会干扰 App Store 中的内容……并不是说似乎需要撤销,因为我正在尝试添加并且不干扰其他开发人员。
UPDATE: I couldn't find a valid identity for the Provisioning Profile, so I created a new Production Certificate (iOS Distribution), then chose that in the Provisioning Profile. Downloaded both and added them to the machine. Restarted Xcode. Now that identity is visible, and the build passes Verification.
更新:我找不到配置文件的有效身份,所以我创建了一个新的生产证书(iOS 分发),然后在配置文件中选择了它。下载了两者并将它们添加到机器中。重新启动Xcode。现在该身份是可见的,并且构建通过了验证。
But iTunes rejects it with a list of a bunch of possible reasons. One solution, "Clean All" seems to not be in Xcode (only a "Clean" option), so I don't know how much to trust in the message.
但是 iTunes 拒绝了它,并列出了一系列可能的原因。一个解决方案,“全部清除”似乎不在 Xcode 中(只有“清除”选项),所以我不知道该消息有多少信任。
"Invalid Signature - Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target."
“无效签名 - 确保您已使用分发证书而不是临时证书或开发证书对应用程序进行签名。验证 Xcode 中的代码签名设置在目标级别是否正确(覆盖项目级别的任何值) . 此外,请确保您上传的包是使用 Xcode 中的 Release 目标构建的,而不是 Simulator 目标。如果您确定代码签名设置正确,请在 Xcode 中选择“Clean All”,删除“build”目录Finder,并重建您的发布目标。”
Yes, I'm certain that everything is right... I was certain each of the dozens of times that I submitted the app.
是的,我确信一切都是正确的...我提交了应用程序的几十次中的每一次我都确信。
回答by Matt
It looks like this question is in regards to an iOS project, but I had a similar problem with my Mac app. Even though I had selected "Don't Code Sign", Xcode was still complaining about a missing identity.
看起来这个问题是关于一个 iOS 项目的,但我的 Mac 应用程序也有类似的问题。即使我选择了“Don't Code Sign”,Xcode 仍然抱怨缺少身份。
I solved it by manually editing the file <Project>.xcodeproj/project.pbxproj
and deleting all lines defining CODE_SIGN_IDENTITY
or CODE_SIGN_ENTITLEMENTS
.
我通过手动编辑文件<Project>.xcodeproj/project.pbxproj
并删除所有定义CODE_SIGN_IDENTITY
或CODE_SIGN_ENTITLEMENTS
.
This might get you back to coding, but obviously won't be a final solution if you intend to submit to the App Store.
这可能会让您重新编码,但如果您打算提交给 App Store,这显然不是最终解决方案。