ios 未安装分发证书/私钥

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47256780/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:37:45  来源:igfitidea点击:

Distribution certificate / private key not installed

iosxcodecertificatekeychain

提问by Michel

Using Xcode 9.1, after building an iOS app, I want to archive it and upload it to the appStore for beta-testing. But I get the following issue after clicking the button Upload to the App Store...and choosing Automatically manage signing:

使用 Xcode 9.1,构建 iOS 应用程序后,我想将其存档并将其上传到 appStore 进行 beta 测试。但是单击按钮Upload to the App Store...并选择后,我遇到以下问题Automatically manage signing

"My Name" has one iOS Distribution certificate but its private key is not installed.

“我的名字”有一个 iOS 分发证书,但未安装其私钥。

I do not know why this "private key is not installed", but the Distribution certificate may have been created on a different computer or something. In any case:

我不知道为什么这个“没有安装私钥”,但分发证书可能是在不同的计算机上创建的。任何状况之下:

What is the simplest way to retrieve the missing private key and install it? In order to make things work.

检索丢失的私钥并安装它的最简单方法是什么?为了让事情顺利进行。

采纳答案by matt

You can only have onedistribution certificate. It unites a public key, known to Apple, with a private key, which lives in the keychain of some computer. If this distribution certificate was created on another computer, then the private key is on the keychain of that computer. And this distribution certificate does not work without it.

您只能拥有一个分发证书。它将 Apple 已知的公钥与私钥结合在一起,私钥位于某些计算机的钥匙串中。如果此分发证书是在另一台计算机上创建的,则私钥位于该计算机的钥匙串中。没有它,这个分发证书就无法工作。

So to use this distribution certificate on this computer, you must find thatcomputer, open Keychain Access, locate and export the private key, mail it or otherwise get it to thiscomputer, and import it into the keychain of this computer.

所以要在这台电脑上使用这个分发证书,你必须找到台电脑,打开钥匙串访问,找到并导出私钥,将它邮寄或以其他方式将其发送到台电脑,并将其导入到台电脑的钥匙串中。

If you go into the Accounts pref pane in Xcode and double-click your Team, you'll see a dialog that gives you help with this. If you see your distribution certificate and it says Not In Keychain, you can control-click that certificate to get a menu item that lets you email whoever created the certificate and ask them to send it to you. That person can use this same import to choose Export Certificate and can email you exported certificate.

如果您进入 Xcode 中的 Accounts pref 窗格并双击您的团队,您将看到一个对话框,为您提供帮助。如果您看到您的分发证书并显示不在钥匙串中,您可以按住 Control 键单击该证书以获取一个菜单项,该菜单项可让您通过电子邮件向创建证书的人发送电子邮件,并要求他们将其发送给您。该人可以使用相同的导入来选择导出证书,并且可以通过电子邮件将导出的证书发送给您。

Either way, the private key or exported certificate will be passworded. You'll need to know the password in order to use it.

无论哪种方式,私钥或导出的证书都将被设置密码。您需要知道密码才能使用它。

回答by Tanjima Kothiya

Step 1:- xcode -> product -> archives -> Click manage certificate enter image description here

第 1 步:- xcode -> 产品 -> 档案 -> 点击管理证书 在此处输入图片说明

Step 2 :- add ios distribution enter image description here

第 2 步:- 添加 ios 发行版 在此处输入图片说明

回答by Paul

This answer is for "One Man" Team to solve this problem quickly without reading through too many information about "Team"

这个答案是为了“One Man”团队快速解决这个问题,而无需阅读太多关于“团队”的信息

Step 1) Go to web browser, open your developer account. Go to Certificates, Identifiers & Profiles. Select Certificates / Production. You will see the certificate that was missing private key listed there. Click Revoke. And follow the instructions to remove this certificate. enter image description hereStep 2) That's it! go back to Xcode to Validate you app. It will now ask you to generate a new certificate. Now you happily uploading your apps.

步骤 1) 转到网络浏览器,打开您的开发者帐户。转到证书、标识符和配置文件。选择证书/生产。您将看到那里列出了缺少私钥的证书。单击撤销。并按照说明删除此证书。 在此处输入图片说明第 2 步)就是这样!返回 Xcode 以验证您的应用程序。现在它会要求您生成一个新证书。现在您可以愉快地上传您的应用程序了。

回答by Yitzchak

EDIT: I thought that the other computer is dead so I'm fixing my answer:

编辑:我认为另一台计算机已经死了,所以我正在修复我的答案:

You should export the certificate from the first computer with it's private key and import it in the new computer.

您应该使用其私钥从第一台计算机导出证书并将其导入新计算机。

I prefer the iCloud way, backup to iCloud and get it in the new computer.

我更喜欢 iCloud 方式,备份到 iCloud 并在新计算机中获取它。

If you can't do it with some reason, you can revoke the certificate in Apple developers site, then let Xcode to create a new one for you, it'll also create a fresh new private key and store it in your Keychain, just be sure to back it up in your preferred way

如果由于某种原因你不能这样做,你可以在苹果开发者网站撤销证书,然后让Xcode为你创建一个新的,它也会创建一个新的私钥并将其存储在你的钥匙串中,只需请务必以您喜欢的方式备份它

回答by fujianjin6471

Add a new Production Certificate here, then download the .cer file and double click it to add it to Keychain.

在此处添加新的生产证书,然后下载 .cer 文件并双击它以将其添加到 Keychain。

All will be fine now, don't forget to restart Xcode!!!

现在一切都会好起来的,不要忘记重新启动Xcode!!!

回答by Sohaib Siddique

revoke all distribution certificate for developer.apple.com and the validate your app in Xcode there will be the option to create a new distribution certificate after you can export key for further use.

撤销 developer.apple.com 的所有分发证书并在 Xcode 中验证您的应用程序,在您可以导出密钥以供进一步使用后,将可以选择创建新的分发证书。

This work for me.

这对我有用。

回答by Chinedu Etoh

If you are using the certificate in a new computer or not. The easiest thing to do would be to revoke the previous certificate relating to the project. Then re-upload to the store. Xcode will generate a new one.

如果您在新计算机上使用该证书。最简单的方法是撤销与该项目相关的先前证书。然后重新上传到商店。Xcode 将生成一个新的。

回答by MobileMon

People's answer here about having the key from the computer is generated are accurate. But if things are still failing, try restarting Xcode after installing a cert

人们在这里关于从计算机生成密钥的答案是准确的。但是如果仍然失败,请在安装证书后尝试重新启动 Xcode

回答by Sam

Just for anyone else who goes through this, the answers above are correct but it can still be a bit confusing especially if you have multiple certificates. These were the steps that I took:

对于经历过这个问题的任何其他人来说,上面的答案是正确的,但它仍然有点令人困惑,尤其是如果您有多个证书。这些是我采取的步骤:

1) First take note of the date in the actual distribution certificate that is missing it's private key. Then go to the keychain application on the other computer and type IOS in the search bar. It will show all of your IOS Developer and Distribution keys so you have to find the right one.

1) 首先记下缺少私钥的实际分发证书中的日期。然后转到另一台计算机上的钥匙串应用程序并在搜索栏中键入 IOS。它将显示您所有的 IOS 开发人员和分发密钥,因此您必须找到正确的密钥。

2) Click the right arrow of each IOS Distribution entry to reveal the certificate and find the one with the correct date and export that one by right clicking and selection export.

2) 单击每个 IOS Distribution 条目的右箭头以显示证书并找到具有正确日期的证书并通过右键单击并选择导出来导出该证书。

3) Then just import it in the keychain of the new computer and at least with XCode 9.3 it immediately recognizes it and corrects the error so you can now upload your achieve.

3)然后只需将其导入新计算机的钥匙串中,至少在 XCode 9.3 中,它会立即识别并纠正错误,以便您现在可以上传您的实现。

回答by M. Mubeen Asif

In my case Xcode was not accessing certificates from the keychain, I followed these steps:

在我的情况下,Xcode 没有从钥匙串访问证书,我按照以下步骤操作:

  1. delete certificates from the keychain.
  2. restart the mac.
  3. generate new certificates.
  4. install new certificates.
  5. clean build folder.
  6. build project.
  7. again clean build folder.
  8. archive now. It works That's it.
  1. 从钥匙串中删除证书。
  2. 重启mac。
  3. 生成新证书。
  4. 安装新证书。
  5. 清理构建文件夹。
  6. 构建项目。
  7. 再次清理构建文件夹。
  8. 现在存档。它的工作原理就是这样。