xcode 代码签名错误:身份“iPhone 开发人员”与默认钥匙串中的任何有效证书/私钥对都不匹配

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

Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain

iphonexcodexcode4

提问by TheLearner

I am trying to create an ad hoc distribution of my App to send to a colleague.

我正在尝试创建我的应用程序的临时分发以发送给同事。

I am getting the following error when trying to Archive my project for distribution:

尝试存档我的项目以进行分发时出现以下错误:

Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain

代码签名错误:身份“iPhone 开发人员”与默认钥匙串中的任何有效证书/私钥对都不匹配

These are the steps which I have followed:

这些是我遵循的步骤:

  1. I have registered the device in the provisioning portal.
  2. I have generated a certificate signing request in keychain.
  3. Using this I have created a DISTRIBUTION certificate in the portal and dragged in keychain and I can see the key under the name.
  4. I have then created a DISTRIBUTION profile in the portal and downloaded it and dragged it into Xcode organiser. It appears to be valid in Organiser as there are no warnings.
  5. Now in the project properties I have choosen this profile in the code signing identity.
  1. 我已在配置门户中注册了该设备。
  2. 我在钥匙串中生成了证书签名请求。
  3. 使用它,我在门户中创建了一个 DISTRIBUTION 证书并将其拖入钥匙串中,我可以在名称下看到密钥。
  4. 然后我在门户中创建了一个 DISTRIBUTION 配置文件并将其下载并将其拖到 Xcode 管理器中。它似乎在 Organizer 中有效,因为没有警告。
  5. 现在在项目属性中,我在代码签名标识中选择了这个配置文件。

Now when I run i get this above error.

现在,当我运行时,出现上述错误。

回答by Iphone_bharat

It appears as if the profile has not been selected. Still "iPhone developer" is selected. Sometimes when I change it in my project properties, it doesn't automatically get reflected in target properties, so double click on your target and set the profile there.

看起来好像还没有选择配置文件。仍然选择“iPhone 开发人员”。有时当我在我的项目属性中更改它时,它不会自动反映在目标属性中,因此双击您的目标并在那里设置配置文件。

Some more steps you may have not done:

还有一些你可能没有做的步骤:

  1. I hope you are doing this all for "Distribution" configuration
  2. You have set your identifier in bundle of target properties as the identifier that you have given in profile, i.e. something like 'com.domainname.appname".
  1. 我希望你做这一切都是为了“分发”配置
  2. 您已将目标属性包中的标识符设置为您在配置文件中提供的标识符,即“com.domainname.appname”之类的内容。

回答by Sunil Targe

When I had this problem. I had followed these steps below.

当我遇到这个问题时。我已按照以下步骤操作。

Step 1:Open Certificate.p12 file on your machine (of course through key chain access) and install again by double click.

步骤1:在你的机器上打开Certificate.p12文件(当然是通过钥匙链访问),然后双击重新安装。

Step 2: It is now imported into your Key Chain.

第 2 步:它现在已导入到您的钥匙串中。

Step 3: Go to your project and set Code Signing Identity properly with your developer profile. You'll get resolved this problem.

第 3 步:转到您的项目并使用您的开发人员配置文件正确设置代码签名标识。你会得到解决这个问题。