Reputation: 1881
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.
I tested 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.
I tried many things:
But this didn't fix my issue.
Any idea what might be the problem?
Upvotes: 188
Views: 145481
Reputation: 1774
Update Xcode 16.1 (11/2024): This method still works.
Update Xcode 13.2.1 (03/2022): This method still works.
In Xcode 11.3.1, the interface has changed from all the current answers.
Deleting the latest "Date Created" certificate should refresh your certificate, but deleting all the revoked certificates is recommended.
After deleting the revoked certificate(s), you should be able to rebuild the app.
Upvotes: 15
Reputation: 7225
In XCode 14.5, I went to XCode -> Settings -> Accounts tab. I clicked on Manage Certificates in the lower right, and chose Apple Distribution in the + button on the left.
Upvotes: 1
Reputation: 1
I deleted MobileDevices keys and their keychain, but it didn’t help me, because the time on my MacBook was 20 minutes late and was not going correctly, after I set the time correctly, deleting the keys and the revoke button worked correctly
Upvotes: 0
Reputation: 69
1.Go to Xcode Menu> Preferences 2. Account Check whether you are signed in with Apple Developer account
Upvotes: 1
Reputation: 1907
Update in Xcode 13.2.1,
For me this error cause by I'm using a free apple developer account. So it will be revoked after a specific time not build that app with certificate. But the Xcode is not recognized to rebuild the certificate again -> That's the reason the error happened.
Just do like turkenh's answer but you don't need to restart Xcode. After you clean the certificate will automatically rebuild.
Upvotes: 0
Reputation: 11
I had this issue and I fixed that.
Manage Certificates...
and You'll see signing certificates menu will pop.Apple Development
and and press Done
button.Upvotes: 0
Reputation: 680
Go to https://www.apple.com/certificateauthority, download all Worldwide Developer Relations - G# certificates and add them to your Mac Keychain. Restart Xcode and try again.
Upvotes: 0
Reputation: 5536
You can also get this error due to conflicting Apple Worldwide Developer Relations Certification Authority certificates.
What worked for me was to delete all the Apple Worldwide developer certificates (not the ones that show your company name) in both the system and login keychains in the the "KeyChain Access" app. The a restart and rebuild with Xcode (9.2) and the problem went away.
Upvotes: 0
Reputation: 2949
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:
Go to Xcode Menu> Preferences
Select Accounts > Team > View Details
Select any Provisioning profile from the Provisioning Profiles list
Right-click > Select Show in Finder. Then you will see all lists of provisioning profiles
Select all provisioning lists from the folder and move them to the trash
Download All provisioning profiles by clicking Download All below Provisioning Profile lists.
Now, run again and it should work!
Upvotes: 294
Reputation: 178
It's work for me:
Xcode
-> Preferences
and select Accounts
tab.Manage Certificates
.Signing certificate for "User name"
manu will pop.Apple Development
from the bottom like below & then press Done
Button.Upvotes: 4
Reputation: 3680
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:
These steps solved the problem for me.
Upvotes: 83
Reputation: 65
In case it helps anyone: Xcode 11.x I revoked also (deleted) a certificate in App Developer account. Then I thought I had deleted the certificate too in Keychain access but kept getting error messages, when trying to upload an app update to the AppStore.
I then found out that there are two separate places in keychain access, where in one the certificate is kept (funny enough under keys, once login is selected in keychains) and in the other one the private key (of course under the item certificates in keychains). I made sure that both are deleted and now all is good.
Upvotes: 0
Reputation: 11
If you have a host test target that you run on the device, make sure that it uses the same code signing identity that the app target uses. Otherwise you will have to clean when you switch between testing and debugging the app.
I had this issue in Xcode 11.4.1 when we turned off code signing in our host test target as a build-time enhancement. Once I turned code signing back on for the host test, I no longer experienced this issue when switching between running the host test target and the app!
Upvotes: 1
Reputation: 2584
For those who cannot find "view details" button at Account > Team > View Details, here is how I solved this on Xcode 10:
and try again.
Upvotes: 104
Reputation: 121
In Xcode 8,
Upvotes: 4
Reputation: 516
Sometimes the "Bundle Identifier" in Xcode is changing due to some things that you made. Make sure the Bundle Identifier you defined in your Apple Developer account is exactly the same as the one in Xcode.
Upvotes: 0
Reputation: 3006
Xcode 11.1 requires generating сertificate from Xcode directly
So you will have smth like this on https://developer.apple.com after
Upvotes: 0
Reputation: 23
Using Xcode 10.3
Follow these steps:
Account
> Certificates, Identifiers & Profiles
> Devices
Xcode
select your iPhone and Run itDo not forget to go Settings
> General
> Device Management
to trust the developer account
Upvotes: 0
Reputation: 1628
I had this issue and it looked like a bug in xcode's 10.x New build system.
Go to File > Project Settings
Change the Build system to use Legacy build system
.
Deep clean the project by holding Option(⎇)+Shift(⇧)+Command(⌘)+K or holding Option(⎇) and selecting Product > Clean Build Folder
Run on a device
Upvotes: 2
Reputation: 31
I had this issue after changing my Email account.
After trying out so many possible solutions, the only one that worked was the to just delete the certificate that was created in that day from my Apple developer account. (It was not the only certificate in my account) It seems that a new certificate was created automatically and it was conflicting with the main one.
Upvotes: 0
Reputation: 7203
With Xcode Version 10.1
I solved with these steps:
Xcode
, Preferences
and select the Accounts
tabExport Apple ID and Code Signing Assets...
exporting this in a file, for example Test.developerprofile
Import Apple ID and Code Signing Assets...
and select your previously exported file Test.developerprofile
Clean
(Shift(⇧)+Command(⌘)+K) and a Build
(Command(⌘)+B)Upvotes: 0
Reputation: 4448
It's not a big issue i faced. Just clean the project and restart your xcode!! Hope it will be working for you! It's working for me. :)
Or First of all clean the project by holding Shift(⇧)+Command(⌘)+K or Select Product > Clean
Then
Go to XCode Menu> Preference
Select Account > Team > View Details
Select any Provisioning profile from Provisioning Profiles list
Right click > Select Show in Finder. Then you will see all lists of provisioning profiles
Select all provisionaling list from the folder and move it to trash
Download All provisioning profiles by clicking Download All below Provisioning Profile lists.
Now, Run again and it should Work!
Upvotes: 0
Reputation: 13053
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.
Upvotes: 12
Reputation: 2467
I just unchecked "Automatically manage signing and checked it again with selecting the Team and it worked for me
Upvotes: 2
Reputation: 775
1.Change the setting of your Mac Timing to Automatic(Open Date& Time Preferences Check on set the Date and Time Automatically).
2.After that go to your X Code, Clean and Run The Code.
3.If it failed, log out of your Apple Profile and Delete all the Automatically Created Provisioning Profiles in XCode -- Preferences and Move all the Provisioning profiles to trash and download as a new file.Then LogIn again and Run your Code.
Upvotes: 1
Reputation: 9362
What finally worked for me was to shut down and restart my MacBook, after downloading latest provisioning profiles.
Upvotes: 2
Reputation: 4331
Sometime, in Xcode 8 you might find yourself in a revoke-regenerate cycle, where you let Xcode 8 "fix" the certificates and provisioning, then Xcode finds the new/regenerated certificates to be invalid also, and you go back to revoke, and it keeps happening.
In such cases, check your MacOS time! If you have it set to some other time, not the real current time, the new certificate may always "not yet" be valid.
Upvotes: 0
Reputation: 892
When nor deleting and re-downloading the profiles, nor "Clean" helps I do this:
Preferences> Accounts> Apple IDs> select your acc> select your team> View Details...> reset your signing identity (iOS Development in my case).
This always worked for me.
Upvotes: 1
Reputation: 1268
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.
This initiates an on-boarding wizard that sets things up correctly for Xcode 8.
Upvotes: 2
Reputation: 46
-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
Upvotes: 2