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

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

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

编辑:

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


当前回答

我通过

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

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

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

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

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

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

.

其他回答

你需要:

1)私钥和公钥。

你的钥匙链上有这个符号

2)由这些密钥的签名请求生成的证书

3)连接到该证书的配置文件

假设你换了电脑,想重新设置Xcode配置文件。你是怎么做到的?

Open Xcode, press ctrl + O to open the Organizer, and delete all provisioning profiles you might have installed already. Open keychain access, and create a signing request which you save to file (when you create the request, a private and public key is created in your keychain). Create/Update a certificate in the provisioning portal by sending apple this signing request Download and install the newly created certificate. Revoke your provisioning profiles and update them with the new certificate. Download and install the newly updated provisioning profiles.

如果你有新的mac,你可以去 IOS开发中心->供应门户->证书->开发->撤销并创建新证书。我的问题解决了。我的错误是“代码签名错误:身份'iPhone开发人员'不匹配任何有效的,未过期的证书/私钥对在您的钥匙串”

我也遇到了同样的问题,试过了所有方法。不管出于什么原因,解决方案是我所有的证书都迁移到一个名为“microsoft_intermediate_certificates”的密钥链上。因为它可能发生在Xcode升级期间,我完全不知道为什么,但它可能会帮助到一些人。

我将微软钥匙串的所有内容移动到登录钥匙串,一切恢复正常。

确保这种情况干净地发生的一个好方法是首先完全清理您的登录密钥链。

另外,一个非常重要的步骤是在导入私钥和公钥之前解锁您的钥匙链

 security unlock-keychain -p password ~/Library/Keychains/login.keychain 

将私钥导入登录keychain:

security import PrivateKey.p12 -k ~/Library/Keychains/login.keychain 

导入1个身份。

将公钥导入登录keychain:

security import PublicKeyName.pem -k ~/Library/Keychains/login.keychain 

1键导入。

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

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