这事让我非常担心。我刚刚下载了iPhone 3.0 SDK,但现在我无法让我的配置文件工作。以下是我的尝试:

删除所有配置配置文件 删除登录keychain 创建新的“登录”钥匙链,使它 默认的 创建一个新的证书签名请求 创建新的开发人员和分销渠道 证书在苹果开发者中心 下载并安装它们 下载并安装WWDR证书 创建一个新的配置文件和 双击它来安装

所有的证书报告都是有效的,但是Xcode仍然不能识别它们。接下来我该试试什么?

编辑:

我完全重新安装了Mac OS X,从一个新的安装安装了3.0 SDK,仍然有同样的问题。


当前回答

对于开发证书,您只需创建一个新的证书并将其与配置文件匹配即可。但是对于分发,就像你要提交给苹果时,你不能这样做,必须使用团队代理创建的分发证书。问题是您需要计算机上的私钥。这很简单,但是,创建证书的团队代理复制私钥给你,下面是来自Apple的说明,我希望这对你有帮助。

It is critical that you save your private key somewhere safe in the event that you need to develop on multiple computers or decide to reinstall your system OS. Without your private key, you will be unable to sign binaries in Xcode and test your application on any Apple device. When a CSR is generated, the Keychain Access application creates a private key on your login keychain. This private key is tied to your user account and cannot be reproduced if lost due to an OS reinstall. If you plan to do development and testing on multiple systems, you will need to import your private key onto all of the systems you’ll be doing work on.

To export your private key and certificate for safe-keeping and for enabling development on multiple systems, open up the Keychain Access Application and select the ‘Keys’ category. Control-Click on the private key associated with your iPhone Development Certificate and click ‘Export Items’ in the menu. The private key is identified by the iPhone Developer: public certificate that is paired with it. Save your key in the Personal Information Exchange (.p12) file format. You will be prompted to create a password which is used when you attempt to import this key on another computer. You can now transfer this .p12 file between systems. Double-click on the .p12 to install it on a system. You will be prompted for the password you entered in Step 4.

其他回答

For Xcode 13 (maybe earlier?) - The key to this is to use the "Build Settings" tab, not the "Signing and Capabilities" tab in your Target Settings. Once you are in "Build Settings", search for the "Signing" section (you can type "Signing" in the search box). There you will see a sub-section called Code Signing Identity. In that section you can click on each line and directly choose any certificate you have in your keychain. You need to do that for all of the relevant configurations (the ones that you want to upload to TestFlight/AppStore). When you go back to the "Signing and Capabilities" tab, you should see the results of what you did and the error should have gone away.

我从下面的答案中得到了灵感:https://stackoverflow.com/a/37043501/826946

但我认为明确地列出这一点可能会有所帮助。

以我为例,我把这个项目从我的iMac复制到我的Macbook Pro,然后发现我的Macbook上没有安装我的私钥。所以我导出了我的私钥,复制并安装到Macbook上,瞧,它工作了!我在这里记录了这些信息: http://www.creatistblog.com/2009/09/iphone-developer-provisioning.html

我登录了开发人员帐户并撤销了开发证书。撤销和下载开发证书后,我双击新下载的证书,这一次私钥在开发证书下的KeyChain访问。

我通过

A)进入门户上的配置文件页面

b)在你遇到麻烦的配置文件上点击Edit(右边)。

c)选中相应的证书框(默认不勾选),选择正确的App ID(我的旧的已经过期了)

d)下载并使用新的配置文件。删除旧的。

显然,这个问题有4个不同的原因:

您的钥匙串缺少与您的 iPhone Developer或iPhone 发行证书。 您的钥匙链缺少苹果全球开发者关系 中级证书。 您的证书已被撤销或已过期。 在线证书状态协议(OCSP)或证书 撤销列表(CRL)被打开 钥匙串访问首选项

.

对我来说,只有当证书和两个密钥都在Login keychain中时,它才有效。我之前创建了一个开发钥匙链,但是Xcode管理器在那里找不到钥匙。所以我把它们移回登录,退出钥匙链工具-瞧,Xcode管理器中的错误消失了!这是在3.1.3 SDK的雪豹10.6.2上。