Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Certificate has either expired or has been revoked

Tags:

xcode

ios

iphone

People also ask

Should expired certificates be revoked?

All replies. Revoking is essentially useless as the certificates are expired. Revocation is for time valid certificates that must be terminated prior to their expiration date. It is technically possible to delete expired certificates but just make sure you will never want to check if they were issued in the past.

What happens when iOS distribution certificate expires?

If your certificate expires, passes that are already installed on users' devices will continue to function normally. However, you'll no longer be able to sign new passes or send updates to existing passes. If your certificate is revoked, your passes will no longer function properly.


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


Solution

First of all, clean the project by holding Shift(⇧)+Command(⌘)+K or Select Product > Clean

Then:

  1. Go to Xcode Menu> Preferences

  2. Select Accounts > Team > View Details

  3. Select any Provisioning profile from the Provisioning Profiles list

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

  5. Select all provisioning lists from the folder and move them to the trash

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

Now, run again and it should work!


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


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.

These steps solved the problem for me.


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

  1. Delete all provisioning profiles at ~/Library/MobileDevice/Provisioning\ Profiles/
  2. Clean the project by holding Shift(⇧)+Command(⌘)+K or selecting Product > Clean (it might be labelled "Clean Build Folder")
  3. Restart Xcode

and try again.


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

Using Xcode 7.3.1

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

Following the link above, I took the advice of

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

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

Xcode prompted to update itself.

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.


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


Found another case which results in bloody Certificate has either expired or has been revoked error in Xcode 9. If you're trying to sign with valid certificate but you do have another revoked certificate in 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 Access solves this. Looks like another code sign bug in Xcode.