Xcode 4 - 在新 Macintosh 安装上配置配置文件时出现“未找到有效签名身份”错误

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

Xcode 4 - "Valid signing identity not found" error on provisioning profiles on a new Macintosh install

iphonexcodecertificatekeychainprovisioning-profile

提问by Oliver

I had a Macintosh I used to develop iPhone apps with using XCode 4. I now have a new Macintosh with a new install of... everything.

我有一个 Macintosh,我曾经使用 XCode 4 开发 iPhone 应用程序。我现在有一个新的 Macintosh,新安装了......一切。

When opening Xcode projects built on the old Mac, I cannot run the app on the iPhone that was configured as a development iPhone.
Xcode 4 organizer tells me "Valid signing identity not found" on my provisioning profiles.

打开在旧 Mac 上构建的 Xcode 项目时,我无法在配置为开发 iPhone 的 iPhone 上运行该应用程序。
Xcode 4 组织者在我的配置文件中告诉我“未找到有效的签名身份”。

I guess this is something to do with the .certSigningRequest file I had generated before on the old Mac (I have a backup of that file), but what do I have to do with it on the new Mac?

我想这与我之前在旧 Mac 上生成的 .certSigningRequest 文件有关(我有该文件的备份),但我在新 Mac 上与它有什么关系?

Another strange thing, I don't see my 5 existing provisioning profiles (defined on Apple provisioning portal) in the organizer, even after a refresh and after having entered my provisioning portal login and password :

另一个奇怪的事情是,即使在刷新并输入了我的配置门户登录名和密码之后,我也没有在管理器中看到我的 5 个现有配置文件(在 Apple 配置门户上定义):

enter image description here

在此处输入图片说明

回答by Steve Liddle

With Xcode 4.2 and later versions, including XCode 4.6, there is a better way to migrate your entire developer profile to a new machine. On your existing machine, launch Xcode and do this:

对于 Xcode 4.2 及更高版本,包括 XCode 4.6,有一种更好的方法可以将您的整个开发人员配置文件迁移到新机器上。在您现有的机器上,启动 Xcode 并执行以下操作:

  1. Open the Organizer (Shift-Command-2).
  2. Select the Devices tab.
  3. Choose Developer Profile in the upper-left corner under LIBRARY, which may be under the heading library or under a heading called TEAMS.
  4. Choose Export near the bottom left side of the window. Xcode asks you to choose a file name and password.
  1. 打开管理器 (Shift-Command-2)。
  2. 选择设备选项卡。
  3. 选择LIBRARY下左上角的Developer Profile,它可能在标题库下或名为TEAMS的标题下。
  4. 选择窗口左下角附近的导出。Xcode 会要求您选择文件名和密码。

Edit for Xcode 4.4:

为 Xcode 4.4 编辑:

With Xcode 4.4, at step 3 choose Provisioning Profiles under LIBRARY. Then select your provisioning profiles either with the mouse or Command-A.

对于 Xcode 4.4,在步骤 3 中选择 LIBRARY 下的 Provisioning Profiles。然后使用鼠标或 Command-A 选择您的配置文件。

Also, Apple is making improvements in the way they manage this aspect of Xcode, and some users have reported that the Refreshbutton in the lower-right corner does the trick. So try clicking Refresh first, and if that doesn't help, do the export/import sequence.

此外,Apple 正在改进他们管理 Xcode 这方面的方式,一些用户报告说右下角的刷新按钮可以解决问题。因此,请先尝试单击“刷新”,如果这没有帮助,请执行导出/导入序列。

Picture for XCode 4.6 added by WP

WP 为 XCode 4.6 添加的图片

enter image description here

在此处输入图片说明

Edit for XCode 5.0 or newer:

编辑 XCode 5.0 或更新版本:

  1. Open XCode -> Preferences ('Command' + ',')
  2. Select the Apple IDfrom the list.
  3. Click on the SETTING icon near the bottom-left corner of window, and choose EXPORT ACCOUNTS... Xcode asks you to choose a file name and password.
  1. 打开 XCode -> 首选项 ('Command' + ',')
  2. 从列表中选择Apple ID
  3. 单击窗口左下角附近的 SETTING 图标,然后选择 EXPORT ACCOUNTS... Xcode 要求您选择文件名和密码。

On your new machine, launch Xcode and import the profile you exported above. Works like a charm.

在您的新机器上,启动 Xcode 并导入您在上面导出的配置文件。奇迹般有效。

Picture for XCode 5.0 added by Ankur

Ankur 添加的 XCode 5.0 图片

For XCode 5 or newer versions

对于 XCode 5 或更新版本

回答by tiguero

I just run into the similar issue today. Unfortunately my HD died on me so I couldn't do the migration mentioned here in the accepted answer. I had to do the following steps:

我今天刚遇到类似的问题。不幸的是,我的 HD 死机了,所以我无法进行已接受的答案中提到的迁移。我必须执行以下步骤:

  1. Connect to the apple developer member center then the iOS provisional portal.
  2. Revoke my certificate.
  3. Create a new certificate by providing a new pair of private and public key.
  4. Remove all the previous provisioning profiles and create new ones.
  5. Download the new provisioning profiles and install them in XCode by just dragging them to the XCode icon in the dock.
  1. 连接到苹果开发者会员中心,然后连接到 iOS 临时门户。
  2. 吊销我的证书。
  3. 通过提供一对新的私钥和公钥来创建新证书。
  4. 删除所有以前的配置文件并创建新的配置文件。
  5. 下载新的配置文件并将它们安装在 XCode 中,只需将它们拖到 Dock 中的 XCode 图标即可。

The same action is also mentioned on this post.

这篇文章也提到了同样的行动。

回答by iOSDevSF

Make sure your certificate is in the "login" keychain. Highlight the login keychain if you don't see it, search for it. Then drag the cert over the words "login". Close and Open XCode, ta-da.

确保您的证书在“登录”钥匙串中。如果您没有看到登录钥匙串,请突出显示,搜索它。然后将证书拖到“登录”字样上。关闭并打开 XCode,ta-da。

回答by LaC

You need to copy over the private key and certificate from your old Mac. Open Keychain Access on the old Mac and look in the Keys category of the login keychain: the key should be there. You need to export both the public and private key, then copy yourkey.pemand yourkey.p12to the new Mac.

您需要从旧 Mac 复制私钥和证书。在旧 Mac 上打开 Keychain Access 并查看登录钥匙串的 Keys 类别:钥匙应该在那里。您需要出口的公共和私有密钥,然后复制yourkey.pemyourkey.p12到新的Mac。

Importing them using Keychain Access will probably fail, at least under 10.6; you can use these commands instead:

使用 Keychain Access 导入它们可能会失败,至少在 10.6 以下;您可以改用这些命令:

security import yourkey.p12
security import yourkey.pem

回答by Bobjt

For the error

对于错误

Valid signing identity not found

未找到有效的签名身份

see Apple's published stepsto resolve this problem.

请参阅 Apple发布的解决此问题的步骤

Regarding the issue of your "5 existing provisioning profiles" on the iOS Portal which are missing from your local library in Xcode 4.x Organizer > Devices tab > Provisioning Profile section under Library.

关于 iOS 门户上的“5 个现有配置文件”的问题,您的本地库在 Xcode 4.x Organizer > Devices 选项卡 > Library 下的 Provisioning Profile 部分中丢失。

I recommend following the stepsthat walks you through restoring missing profiles and also covers the case of an Xcode bug in which Xcode 4.1-4.2.1 mistakenly deletes from your local library profiles which are "Active" on the iOS Portal.

我建议按照指导您恢复丢失的配置文件的步骤进行操作,并且还涵盖了 Xcode 错误的情况,其中 Xcode 4.1-4.2.1 错误地从 iOS 门户上“活动”的本地库配置文件中删除。

回答by Legolas

You will have to go to your developer site, go to your certificates, and generate a new onefor your current MAC and add it to your keychain.

您必须转到您的开发人员站点,转到您的证书,然后为您当前的 MAC生成一个新证书并将其添加到您的钥匙串中。

And then you will need to add the Provisioning Profile again. It should work now. Basically you need to perform the same stepsyou did when you first got your Dev Certificate.

然后您将需要再次添加配置文件。它现在应该可以工作了。基本上,您需要执行与第一次获得开发证书时相同的步骤

回答by Has AlTaiar

I had the same error but the issue was slightly different. We have a team of developers but we all use the same Apple ID (Developer Account), so when I generated the Provisioning profile, I kept getting the same error as in the subject question. Then although I had downloaded the certificate (that gets prompted as part of the Development Provisioning Assistant steps), I was still getting that error. Then I found the issue was that our Apple Developer account was using a Certificate that was generated on my work mate machine, so I needed to revoke it, and generate a new certificate, then create the provisioning profile.

我有同样的错误,但问题略有不同。我们有一个开发人员团队,但我们都使用相同的 Apple ID(开发人员帐户),所以当我生成配置文件时,我不断收到与主题问题相同的错误。然后,尽管我已经下载了证书(在 Development Provisioning Assistant 步骤中得到提示),但我仍然收到该错误。然后我发现问题是我们的 Apple Developer 帐户使用的是在我的同事机器上生成的证书,所以我需要撤销它,并生成一个新证书,然后创建配置文件。

The Summary, the lesson learned is that the certificate that is used for your provisioning profile must be generated on the same computer where the provisioning profile will be used. This is especially important to consider when you have a team of developers sharing the same Apple ID.
Hope it helps somebody

总结,吸取的教训是,用于您的供应配置文件的证书必须在将使用供应配置文件的同一台计算机上生成。当您的开发团队共享同一个 Apple ID 时,这一点尤其重要。
希望它可以帮助某人

回答by superjos

My 2 cents on this error, even if notrelated to an export/import scenario:

我的2美分,这一错误,即使涉及到导出/导入方案:

when adding the mobile provisioning certificate (i.e. the PROVfile), DO NOTdrag the file from Finder to Keychain Access. Instead, just double click the PROV file within Finder, while keeping the Keychain Access application running somewhere.

添加移动配置证书(即PROV文件)时,请勿将文件从 Finder 拖到 Keychain Access。相反,只需在 Finder 中双击 PROV 文件,同时让 Keychain Access 应用程序在某处运行。

I've actually seen my former provisioning item in Keychain (the one with yellow light) being substituted with a new, green one with same name and app ID. HTH

我实际上已经看到我以前在钥匙串中的配置项(带黄灯的那个)被一个新的、具有相同名称和应用程序 ID 的绿色项替换。HTH

回答by Neeku

I faced this problem this morning when I just opened an old app with a different certificate and allowed its access to the keychain. My other app that was working pretty well, stopped working with this error. I've been pulling out my hair till now, when I simply did this:

今天早上我刚用不同的证书打开一个旧应用程序并允许它访问钥匙串时遇到了这个问题。我的另一个运行良好的应用程序因此错误而停止工作。直到现在我一直在拔头发,当时我只是这样做:

Xcode Menu > Preferences > Accounts > THE_APPLE_ID_THAT_YOU_ARE_USING > View Details

Xcode 菜单 > 首选项 > 账户 > THE_APPLE_ID_THAT_YOU_ARE_USING > 查看详情

In the new window, at the bottom left of the Signing identitiespress the +button and select iOS Development. It'll re-add the identity, and after that my problem is fixed now and the app is running on the device again.

在新窗口中,Signing identities按左下角的+按钮并选择iOS Development。它将重新添加身份,之后我的问题现在得到解决,应用程序再次在设备上运行。

enter image description here

在此处输入图片说明

回答by iSaalis

My MAC OS Crashed recently. I reinstalled Mac 10.7.4and XCode 4.5. But all provisioning profiles were showing the following message in organizer.

我的 MAC OS 最近崩溃了。我重新安装Mac 10.7.4XCode 4.5。但是所有配置文件都在organizer.

Valid Signing identity not found

I struggled to find help for a couple of days. Later I realized that if you have migrated from one system to another(or formatted your system), you need to export your private key from your keychain from your old system to the new system (or new OS installed).

几天来,我一直在努力寻求帮助。后来我意识到,如果您从一个系统迁移到另一个系统(或格式化您的系统),您需要将您的私钥从旧系统的钥匙串导出到新系统(或安装的新操作系统)。

One can also export your developer profile/team developer profile in organizer.

还可以在管理器中导出您的开发人员配置文件/团队开发人员配置文件。

Organizer > Teams > Developer Profile > Export

Hope it helps.

希望能帮助到你。