简体   繁体   English

无法在 Xcode 中创建分发应用程序

[英]Failing to create distribution app in Xcode

I'm trying to upload my app into App Store through Xcode, I read a few sites and set the code signing to "iOS Distribution" but when I tried to Archive, an error appear "No provisioning profiles with a valid signing identity (ie certificate and private key pair) were found."我正在尝试通过 Xcode 将我的应用程序上传到 App Store,我阅读了一些站点并将代码签名设置为“iOS 分发”,但是当我尝试存档时,出现错误“没有具有有效签名身份的配置文件(即证书和私钥对)被发现。”

I've created a new distribution Provisioning Profile in developer.apple.com and link it to my app and selected the distribution certificate to it.我在 developer.apple.com 中创建了一个新的分发配置文件并将其链接到我的应用程序并为其选择分发证书。 I then downloaded this profile and manage to select it in the provisioning profile section in xCode->build settings->code signing.然后我下载了这个配置文件并设法在 xCode-> 构建设置-> 代码签名的配置文件部分中选择它。 But now I noticed that I can't select any Signing Identity with it saying "No Identities from profile "profileName"".但是现在我注意到我无法选择任何签名标识,上面写着“没有来自个人资料“profileName”的身份”。 And trying to Archive will just popout the same error as paragraph above.尝试存档只会弹出与上面段落相同的错误。

If I choose "Fix Issue" when the error popup, it resets the Signing Identity to "iOS Developer" and the profile to "Automatic".如果我在错误弹出时选择“修复问题”,它会将签名标识重置为“iOS 开发人员”,并将配置文件重置为“自动”。 The archive process runs but when I tried to validate or export an error popup;存档过程会运行,但是当我尝试验证或导出错误弹出窗口时; "Your account already has a valid iOS distribution certificate". “您的帐户已有有效的 iOS 分发证书”。

I read somewhere that this is maybe due to multiple certificates in Keychain, but I'm not sure which one to delete:我在某处读到这可能是由于钥匙串中有多个证书,但我不确定要删除哪一个:

我的证书截图
as you can see, I have a number of certs and some seems to have the same name.如您所见,我有许多证书,有些证书似乎具有相同的名称。 The 1st, 2nd, and 4th, is the name of my company (with the same id), while the 3rd and 5th, is my name (with the same id). 1号、2号、4号是我公司的名字(ID相同),3号和5号是我的名字(ID相同)。

Now here's a weirder thing I noticed;现在我注意到一件更奇怪的事情; in Certificates section of Keychain, I have 2 of the same thing (exactly same name) but their expiry date is different with the one without the key have the same expiry date as the one in the Apple Developer page.在 Keychain 的 Certificates 部分,我有 2 个相同的东西(完全相同的名称),但它们的到期日期不同,没有密钥的一个与 Apple Developer 页面中的到期日期相同。

在此处输入图片说明

Any idea what's going on (and how to possibly fix it)?知道发生了什么(以及如何解决)? Can it be someone (we do have other developer for other projects) actually removes the distribution certificate that I have and created another one (causing the whole thing to not sync)?是否有人(我们确实有其他项目的其他开发人员)实际上删除了我拥有的分发证书并创建了另一个分发证书(导致整个事情不同步)? If that's the case do I need to ask him to export it and send it to me?如果是这种情况,我是否需要要求他将其导出并发送给我? Thank you.谢谢你。

Case 1:情况1:

If you can use the computer that generated the certificate.如果您可以使用生成证书的计算机。

Xcode -> preferences -> Choose account -> viewDetails -> choose certificate (Distribution) -> Click setting button and export it Xcode -> 首选项 -> 选择账户 -> 查看详情 -> 选择证书(分发) -> 点击设置按钮并导出

Copy to your computer Do same step but import this time.复制到您的计算机 执行相同的步骤,但这次导入。

Case 2:案例2:

IF you don't have the computer that generated the certificate.如果您没有生成证书的计算机。

You have to revoke the certificate and create a new one.您必须撤销证书并创建一个新证书。 (you have to be admin) (你必须是管理员)

Xcode -> preferences -> Choose account -> viewDetails -> choose certificate (Distribution) -> Click setting button and Revoke it. Xcode -> 首选项 -> 选择帐户 -> 查看详细信息 -> 选择证书(分发) -> 单击设置按钮并撤销它。 And Request new by clicking + button beside the setting.并通过单击设置旁边的 + 按钮请求新的。 And use it.并使用它。

OR或者

You can revoke it form https://developer.apple.com and regenerate.您可以从https://developer.apple.com撤销它并重新生成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM