xcode 配置文件“XXXXXX”不包括签名证书“​​iPhone Distribution: XXXXXXXXXX (XXXXXXXXXX)”。

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

Provisioning profile "XXXXXX" doesn't include signing certificate "iPhone Distribution: XXXXXXXXXX (XXXXXXXXXX)".

objective-cxcodeprovisioning-profileprivate-key

提问by avrospirit

I have been asked to update an old project done in objective-c.

我被要求更新一个在objective-c 中完成的旧项目。

I'm having this issue with my distribution provisioning profile. It goes like this

我的分发配置文件存在此问题。它是这样的

Provisioning profile "XXXXXX" doesn't include signing certificate "iPhone Distribution: XXXXXXXXXX (XXXXXXXXXX)".

配置文件“XXXXXX”不包括签名证书“​​iPhone Distribution: XXXXXXXXXX (XXXXXXXXXX)”。

The thing is I can see the certificate "iPhone Distribution: XXXXXXXXXX (XXXXXXXXXX)" in my keychain. But there are 2 of them. One has a private key and the other one doesn't and both have a different expiry date. When I checked the developer account, the distribution provisioning profile is signed with certificate that doesn't have a private key (the expiry date of the certificate shown on developer account is that of the one without private key)

问题是我可以在我的钥匙串中看到证书“iPhone Distribution: XXXXXXXXXX (XXXXXXXXXX)”。但是有2个。一个有私钥,另一个没有,而且两者都有不同的到期日期。当我检查开发者帐户时,分发配置文件是使用没有私钥的证书签名的(开发者帐户上显示的证书的到期日期是没有私钥的证书)

  1. What is causing this issue?
  2. How can I fix it?
  3. What if I can't get the private key from the older machine(as that machine is no more usable)
  1. 是什么导致了这个问题?
  2. 我该如何解决?
  3. 如果我无法从旧机器获取私钥怎么办(因为该机器不再可用)

I tried deleting one of the certificates, and also automatically manage signing. Both didn't work.

我尝试删除其中一个证书,并自动管理签名。两者都不起作用。

Please help.

请帮忙。

回答by wottle

  1. The problem is that the only valid provisioning profile you have tied to the distribution certificate for which you do not have the private key. Without the private key, it is not a valid signing identity, so Xcode won't use it.

  2. To fix this, You will need to create a new private key / distribution certificate, and then create a new distribution profile using the newly created certificate. You can find instructions, starting with creating the cert signing request, here.

  3. See 2 above. Without the key, you can't use the existing certificate. If you are needing to build from multiple Macs, you need to set up a sharing mechanism to provide the private key to any other Macs that will be downloading and using the certs / profiles from the Apple's site. I would also back up the private key so that you won't run into this in the future if something happens to your build Mac. Also, when the cert expires, it is helpful to keep the .csr file from answer 2 above. This means you can use the same private key for the new cert when your distribution cert expires.

  1. 问题是您绑定到分发证书的唯一有效配置文件您没有私钥。没有私钥,它不是有效的签名身份,因此 Xcode 不会使用它。

  2. 要解决此问题,您需要创建一个新的私钥/分发证书,然后使用新创建的证书创建一个新的分发配置文件。您可以在此处找到说明,从创建证书签名请求开始

  3. 见上文2。没有密钥,您将无法使用现有证书。如果您需要从多台 Mac 进行构建,则需要设置一个共享机制,以将私钥提供给将要从 Apple 站点下载和使用证书/配置文件的任何其他 Mac。我还会备份私钥,以便将来如果您的构建 Mac 出现问题,您就不会遇到这种情况。此外,当证书过期时,将 .csr 文件保留在上面的答案 2 中会很有帮助。这意味着当您的分发证书过期时,您可以为新证书使用相同的私钥。