[英]Xcode Code Sign error because of no Keys in Keychain
You might think, not again such a question where are already thousands of topics about.你可能会想,不再是这样一个问题,那里已经有数千个话题了。 However, I've not been capable of finding the answer I needed to fix this problem.
但是,我一直无法找到解决此问题所需的答案。
None of these topics go as deep as the Keychain.这些主题都没有钥匙链深入。
When I'm trying to deploy my app to an iPhone, I'm receiving the following message:当我尝试将我的应用程序部署到 iPhone 时,我收到以下消息:
Code Sign error: The identity 'iPhone Developer: [Name] ([ID])' doesn't match any valid, non-expired certificate/private key pair in your keychains.
Now, as said, I have been looking for multiple guides or fixes, however, none of them seemed to fix this issue.现在,如上所述,我一直在寻找多个指南或修复程序,但是,它们似乎都没有解决此问题。
Things I've tried:我尝试过的事情:
After trying all of these ways, I've still not been able to solve the issue.在尝试了所有这些方法后,我仍然无法解决问题。 One problem I've seen is that at first hand, the certificate in the Keychain was showing an invalid status, which is now solved.
我看到的一个问题是,一开始,钥匙串中的证书显示无效状态,现在已解决。
However, if I'm right, there are supposed to be two keys attached to the certificate.但是,如果我是对的,应该有两个密钥附加到证书上。 A public and private key, and these are not showing.
公钥和私钥,这些都没有显示。
Neither are there any keys showing in the Keys tab in the Keychain Access. Keychain Access 的 Keys 选项卡中也没有显示任何密钥。
(Thanks to nsgulliver) (感谢 nsgulliver)
Provisioning profiles installed on the devices or signed with for the target might not be valid, try to go to Organizer->Provisioning profile
and see if the profiles have the valid status?安装在设备上或为目标签名的配置文件可能无效,请尝试转到
Organizer->Provisioning profile
并查看配置文件是否具有有效状态? if not try to delete & refresh them, if they appear valid after refreshing then it might solve your problem if not then you should remove all the entries from keychain
and delete profiles on your provisioning portal and try to create from scratch, if you still face the problem then take help from step by step guide tutorial如果不尝试删除并刷新它们,如果它们在刷新后看起来有效,那么它可能会解决您的问题,如果不是,那么您应该从
keychain
删除所有条目并删除配置门户上的配置文件并尝试从头开始创建,如果您仍然面临问题然后从分步指南教程中寻求帮助
You cannot re-create matching keys, that would defeat the whole purpose of them.您无法重新创建匹配的密钥,这会破坏它们的全部目的。 You need to find the old keys or start the signing procedure from scratch.
您需要找到旧密钥或从头开始签名过程。
Are you using the same machine that you generated the keys on?您使用的是生成密钥的同一台机器吗? If not, go to the other machine, export the developer profile, then import it on the new machine.
如果没有,请转到另一台机器,导出开发人员配置文件,然后在新机器上导入。
Can you restore the keys from backups?您可以从备份中恢复密钥吗? If not, stop everything you are doing and configure your computer for backups before you do anything else.
如果没有,请停止您正在执行的所有操作并在您执行任何其他操作之前配置您的计算机进行备份。
If you are really stuck, you will have to follow the signing procedure right from the very beginning, where you request a certificate from a certificate authority.如果你真的被卡住了,你必须从一开始就遵循签名程序,在那里你向证书颁发机构申请证书。 This will generate new keys, and you will have to create matching provisioning profiles, then set your application to be signed with these.
这将生成新密钥,您必须创建匹配的配置文件,然后将您的应用程序设置为使用这些密钥进行签名。 Dlete the old provisioning profiles, they will be useless without the old keys.
删除旧的配置文件,如果没有旧密钥,它们将毫无用处。
Required reading when you're having code signing problems:当您遇到代码签名问题时需要阅读:
Technical Note TN2250: iOS Code Signing Troubleshooting 技术说明 TN2250: iOS 代码签名故障排除
Nothing will help you more than really understanding what's in your certificates and what isn't, where the necessary pieces are kept, and how they're used.没有什么比真正了解证书中的内容和不包含的内容、必要部分的保存位置以及它们的使用方式更能帮助您了。 This isn't the last time that you'll have code signing issues, and this tech note provides a long checklist that should help you make sure that everything is in the right place to help you develop your app and ultimately sign and submit it to the app store.
这不是您最后一次遇到代码签名问题,本技术说明提供了一个很长的清单,可以帮助您确保一切都在正确的位置,以帮助您开发应用程序并最终签名并将其提交给应用商店。
When I've had this problem in the past I've just deleted everything on my local machine and started again.当我过去遇到这个问题时,我刚刚删除了本地机器上的所有内容并重新开始。 So:
所以:
I find that this is the quickest way to fix any provisioning / key problems, as you can spend hours finding that you've missed something small.我发现这是解决任何配置/关键问题的最快方法,因为您可能会花费数小时发现自己错过了一些小问题。
删除所有旧的配置文件( ~/Library/MobileDevice/Provisioning Profiles/
)并更新 xCode 后,可以再次找到证书。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.