ios 证书已过期或已被吊销

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

Certificate has either expired or has been revoked

iosiphonexcode

提问by user6218736

A while ago I started coding a new ios app, after a long break from it, I'm working on it again and have it almost complete.

不久前,我开始编写一个新的 ios 应用程序,经过长时间的休息后,我又重新开始工作,并且几乎完成了。

I test it on the simulator but when I tried to install it on my iphone 6 (something I have already done in the past) I got an error telling me that my app cannot be installed since the certificate that was used to sign this app expired or has been revoked.

我在模拟器上对其进行了测试,但是当我尝试将它安装在我的 iphone 6 上时(我过去已经做过)我收到一个错误,告诉我我的应用程序无法安装,因为用于签署此应用程序的证书已过期或已被撤销。

I tried many things:

我尝试了很多东西:

  1. I deleted all certificates and provisioninig profiles from xcode, keychain and apple developer and let xcode create me new ones
  2. I deleted xcode and did the whole proccess from the begining
  1. 我从 xcode、keychain 和 apple developer 中删除了所有证书和配置文件,让 xcode 为我创建新的
  2. 我删除了 xcode 并从一开始就完成了整个过程

But this didn't fix my issue.

但这并没有解决我的问题。

Any idea what might be the problem?

知道可能是什么问题吗?

回答by Md.Riduanul Islam

Edit:This answer doesn't work for Xcode 10 and higher. See turkenh's answer.

编辑:此答案不适用于 Xcode 10 及更高版本。参见 turkenh 的回答。



Solution

解决方案

First of all, clean the project by holding Shift(?)+Command(?)+Kor Select Product> Clean

首先,通过按住Shift(?)+Command(?)+K或选择Product> Clean 来清理项目

Then:

然后:

  1. Go to Xcode Menu> Preferences

  2. Select Accounts> Team> View Details

  3. Select any Provisioning profile from Provisioning Profiles list

  4. Right click > Select Show in Finder. Then you will see all lists of provisioning profiles

  5. Select all provisioning list from the folder and move it to trash

  6. Download All provisioning profiles by clicking Download Allbelow Provisioning Profile lists.

  1. 转到 Xcode菜单>首选项

  2. 选择“帐户”>“团队”>“查看详细信息”

  3. 从供应配置文件列表中选择任何供应配置文件

  4. 右键单击 > 选择在 Finder 中显示。然后您将看到所有配置文件列表

  5. 从文件夹中选择所有配置列表并将其移至垃圾箱

  6. 点击下载所有预置描述文件的下载全部低于供应配置文件列表。

Now, run again and it should work!

现在,再次运行,它应该可以工作了!

回答by Anthony Dito

Edit:This answer doesn't work for Xcode 10 and higher. See turkenh's answer.

编辑:此答案不适用于 Xcode 10 及更高版本。参见 turkenh 的回答。



I had experienced this problem and was able to find an answer.

我遇到过这个问题并且能够找到答案。

The answer which this is coming from can be found here.

这是来自的答案可以在这里找到。

Here is what you have to do:

这是你必须做的:

  1. Go to Preferences->Accounts
  2. Press on your account
  3. Click "View Details"
  4. Click "Download All" in the lower left hand corner.
  1. 转到首选项-> 帐户
  2. 按您的帐户
  3. 点击“查看详情”
  4. 单击左下角的“全部下载”。

These steps solved the problem for me.

这些步骤为我解决了问题。

回答by turkenh

For those who cannot find "view details" button at Account > Team > View Details, here is how I solved this on Xcode 10:

对于那些在Account > Team > View Details找不到“查看详细信息”按钮的人,以下是我在Xcode 10上解决此问题的方法:

  1. Delete all provisioning profiles at ~/Library/MobileDevice/Provisioning\ Profiles/
  2. Clean the project by holding Shift(?)+Command(?)+Kor selecting Product > Clean(it might be labelled "Clean Build Folder")
  3. Restart Xcode
  1. 删除 ~/Library/MobileDevice/Provisioning\ Profiles/ 中的所有配置文件
  2. 通过按住Shift(?)+Command(?)+K或选择Product > Clean(它可能标记为“Clean Build Folder”)来清理项目
  3. 重启Xcode

and try again.

然后再试一次。

回答by bshirley

I had a slightly different solution. It may have been from updates, or my particular use case.

我有一个稍微不同的解决方案。它可能来自更新或我的特定用例。

Using Xcode 7.3.1

使用 Xcode 7.3.1

I am using a file sharing system (dropbox) to develop on two different machines. Using the Download Allsolution didn't fix it for me.

我正在使用文件共享系统(保管箱)在两台不同的机器上进行开发。使用该Download All解决方案并没有为我修复它。

Following the link above, I took the advice of

按照上面的链接,我听取了

delete all the profiles in ~/Library/MobileDevice/Provisioning Profiles

删除 ~/Library/MobileDevice/Provisioning Profiles 中的所有配置文件

(which is an extreme measure, but Xcode should now download what you need)

(这是一个极端的措施,但 Xcode 现在应该下载你需要的东西)

Xcode prompted to update itself.

Xcode 提示自我更新。

I still have an issue when switching between developing on the different machines. It presents the following warning/failure:

在不同机器上的开发之间切换时,我仍然遇到问题。它显示以下警告/失败:

This application's application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed.

此应用程序的应用程序标识符权利与已安装应用程序的权利不匹配。这些值必须匹配才能允许升级。

The resolution to that issue is to delete the development item off of the device, and it will then reinstall.

该问题的解决方案是从设备中删除开发项目,然后重新安装。

回答by marceloquinta

A simple "Clean" (Shift(?)+Command(?)+K) solved to me

一个简单的“清理”(Shift(?)+Command(?)+K)解决了我

回答by Alexander Vasenin

Found another case which results in bloody Certificate has either expired or has been revokederror in Xcode 9. If you're trying to sign with valid certificatebut you do have another revoked certificatein the same team on your keychain, Xcode throws this error. To check if you do have revoked certificate see Xcode -> Preferences -> Accounts -> Your Apple ID -> Your Team -> Manage Certificates. Deleting revoked certificate with Keychain Accesssolves this. Looks like another code sign bug in Xcode.

发现了另一种情况下,这会导致血腥的Certificate has either expired or has been revoked错误Xcode 9。如果您尝试使用有效证书进行签名,但您的钥匙串上的同一团队中确实有另一个已撤销的证书,则 Xcode 会引发此错误。要检查您是否确实已撤销证书,请参阅Xcode -> Preferences -> Accounts -> Your Apple ID -> Your Team -> Manage Certificates。删除吊销的证书可以Keychain Access解决这个问题。看起来像 Xcode 中的另一个代码签名错误。

回答by u6160893

In Xcode 8,

在 Xcode 8 中,

  1. Go to Preferences->Accounts
  2. Press on your account
  3. Click "View Details"
  4. Delete profile which you need
  5. Click "Download All" in the lower left hand corner.
  1. 转到首选项-> 帐户
  2. 按您的帐户
  3. 点击“查看详情”
  4. 删除您需要的配置文件
  5. 单击左下角的“全部下载”。

回答by Tarun M

-Open Keychain - Check all certificates by selecting it. - Check status if it is valid or not. -If certificate is not valid then right click on it and delete that certificate

- 打开钥匙串 - 通过选择它来检查所有证书。- 检查状态是否有效。- 如果证书无效,则右键单击它并删除该证书

回答by Richard

A new problem with Xcode 8, what worked for me was to turn off the new "automatically manage signing" checkbox on the General tab for the target, then turn it back on.

Xcode 8 的一个新问题,对我有用的是在目标的常规选项卡上关闭新的“自动管理签名”复选框,然后重新打开它。

This initiates an on-boarding wizard that sets things up correctly for Xcode 8.

这将启动一个入门向导,为 Xcode 8 正确设置。

回答by Mike Taverne

What finally worked for me was to shut down and restart my MacBook, after downloading latest provisioning profiles.

最终对我有用的是在下载最新的配置文件后关闭并重新启动我的 MacBook。