NeoID
NeoID

Reputation: 901

Your account already has a valid Developer ID Application certificate

The last couple of days I've struggled with code signing my cocoa app in Xcode. I've read through all similar topic that looked to be related, but nothing has helped.

Whenever I try to export my archive I get this error message:

enter image description here

I've tried to delete everything in my keychain and all profiles/certificates that I'm allowed to delete/revoke in the member center. However, I still get the same error with no "Fix" or "Reset" button. How should I proceed in order to get my application signed for distribution outside of store?

Upvotes: 40

Views: 34486

Answers (9)

Y.Bonafons
Y.Bonafons

Reputation: 2349

Same issue here but i was using "automatically manage settings" on Xcode 8. And for a particular reason there were two distribution certificates in my developer account.

Xcode seems to choose the most recent automatically and I didn't have it installed on my mac. So I switch to the old way by creating manually my app ID and my provisioning profile (which use the appropriate certificate) and it works :)

Upvotes: 1

Dorald
Dorald

Reputation: 723

On Xcode Version 8.3.3 go to Preferences ->Accounts -> Manage Certificates -> then click (+) ->on dropdown menu click iOS Development. Do the same for iOS App Store -> Done -> Download All Profiles.

Upvotes: 0

Rafy
Rafy

Reputation: 837

I ran into this same issue, and I fixed it at last. There are some tips:

  1. in Xcode -> Preferences -> Accounts, click button View Details, then click button Download All Profiles

  2. in Keychain Access, check if the certificate exists. if not, choose File->Import items, then choose the .cer file you download from developer website

Hope it helps.

Upvotes: 0

pkamb
pkamb

Reputation: 35032

I'm hitting this same issue.

The error appears to be telling you that valid Developer ID Certs have been created under your developer account, but they are not currently on your Mac, so they cannot be used.

The solution would be to download the Developer ID Cert(s) from the web. However, you likely do not have the Private Key used to sign these certs. So at this point they are rather useless.

In my case, the further problem is that I already have 5 Developer ID Certificates in my account. I'm not quite sure where these came from. They were created years ago, perhaps when I was attempting to create Mac App Store certs? Or perhaps by clicking that damn Fix Issue button...

There appears to be a limit of 5 Developer ID Certificates per developer account, by default.

Developer ID Certificates are created, now, through Xcode rather than via the Members Center:

Can't create certs online

However, in Xcode, there is no longer a button to "Create" a new cert. The only button is "Reset". This button simply links me back to the Members Center in my web browser, so is completely useless...

Create certs via Xcode

Via the Members Center, Developer ID Certificates cannot be revoked, as you would an iOS or Mac App Store certificate. The "Revoke" button is Grayed out.

Revoke grayed out

You can’t revoke Developer ID or Pass Type ID certificates using Member Center. Instead, send a request to Apple at [email protected] to revoke these types of certificates.

Apple will only revoke these certificates in cases of security, to disable installation of the app on all client machines. I've tried emailing the above address, and they told me they could not revoke the cert.

The solution, then, is to have additional Developer ID Certificate slots added to your account, past the limit of 5.

Product Security told me, rather than revoking the certs,

We encourage you to contact Apple Developer Connection at https://developer.apple.com/support/ to resolve the issue you’re experiencing.

I've now contacted developer support. I recommend calling. They are currently, hopefully, setting up new Developer ID slots on my dev account.

When you create a new Developer ID Certificate that you will actually use, be sure to back up the Certificate and Private Key so that you do not hit this issue in the future.

EDIT:

I waited for over a month, I believe, with no response. I happened to have a ticket to an Apple TV Tech Talk and talked to an Apple representative at their lab. He was able to reset my Developer ID Certificate limit in about 5 minutes. So this is possible, but to expedite the process I would attempt to talk with a Developer Evangelist at Apple either in person or over the phone.

Upvotes: 6

Tim Bernikovich
Tim Bernikovich

Reputation: 5945

I had similar issue. I've discovered that my provisioning profile was invalid since I've updated iOS Developer certificate. After PP regeneration everything works as expected.

Upvotes: 0

Vaibhavi
Vaibhavi

Reputation: 1

If you have changed the machine Exporting the developer account from old mac and then importing into new mac solves the problem

Upvotes: -1

lukkea
lukkea

Reputation: 3614

I had installed my Developer ID Application Certificate on a different Mac and was getting the same error as in the question when I tried to use that certificate on a "new" Mac.

This fixed it for me:

I still have the other Mac so I exported the Developer Accounts from that one again:

  1. Go to XCode | Preferences | Accounts
  2. Click the "cog" in the bottom-left-hand-corner next the the plus and minus signs
  3. Click "Export Developer Accounts"
  4. Save the exported file somewhere accessible to your other Mac

Then, on my "new" Mac:

  1. Go to XCode | Preferences | Accounts
  2. Select the Apple ID that represents my dev certs
  3. Click the minus sign in the bottom left hand corner to delete that account
  4. Quit XCode
  5. Open Key Chain Access
  6. Delete all Developer Certificates
  7. Close Keychain Access
  8. Go to XCode | Preferences | Accounts
  9. Click the "cog" in the bottom-left-hand-corner next the the plus and minus signs
  10. Click "Import Developer Accounts"
  11. Select the file exported on the "old" Mac above and import

Upvotes: 11

FreeNickname
FreeNickname

Reputation: 7814

Go to Preferences -> Accounts, choose your account, click "View Details" in the bottom right corner and in the dialog click Download all in the bottom left corner.

Also, take a look at fastlane.tools. It is a great set of tools, which is, among other things, capable of dealing with code signing issues. Calling cert and sigh is sometimes enough to deal with many code signing-related problems. Preferences Dialog

Upvotes: 23

bbarnhart
bbarnhart

Reputation: 6710

One issue could be the private key is missing for your developer cert. With Keychain Access find your developer cert and verify it has a little triangle beside it. Click on the triangle to reveal the private key.

If it's not there you'll need to restore this private key from the Mac you created your certificate.

Otherwise, delete the cert from the Apple Developer website and then create a new one.

Upvotes: 2

Related Questions