72

I'm using the latest XCode (6.1) and I need to submit the app as soon as possible, but I can't seem to get around the "Your account already has a valid iOS distribution certificate" error.

I have the client's provisioning profile and I have his distribution certificate (which is valid) and his private key (I've checked using Keychain, it's definitely there). The bundle ID is also correct. I've deleted my provisioning profiles and certificates and reinstalled the client's many times now.

What could be causing this issue? I've seen a lot of topics here on SO with this problem, so I apologise beforehand for creating yet another clone, but I really don't know how to fix this.

edit: I'm running a brand new install of Yosemite by the way

João Pereira
  • 3,482
  • 7
  • 41
  • 52
  • that may help on you: https://developer.apple.com/library/ios/technotes/tn2407/_index.html (you can find the related link under the *No Identities Are Available For Signing* subtitle). – holex Nov 03 '14 at 17:03
  • that link still would be able to give a guideline for solving the problem: https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/Troubleshooting/Troubleshooting.html (a possible solution is under the *Certificate Issues* section). – holex Nov 03 '14 at 17:07
  • Thanks for the input, but that link basically tells me to Revoke and request a new certificate. I don't want to do it because my client's certificate is valid and I've got the client's private key and the provisioning profile, so in theory it should work, right? – João Pereira Nov 03 '14 at 17:34
  • I have revoked certificates and profile a bunch of times without getting it to work. – djcj Nov 05 '14 at 17:34

13 Answers13

34

Got it solved by editing the iOS Distribution Provision Profile in the Developer Member Center.

For some reason there were 2 certificates to choose from for the Distribution Provisioning Profile. I switched over to the other certificate and I could Validate and Submit my Archive build for beta testing.

So, you may have more than one certificate for signing your Provision profiles. Make sure you have the right one (by trying all of them) and hopefully that should work.

I tried many things like Exporting Developer profile from Xcode Accounts and importing it in the organizer, installing the provision profiles from the member center, adding them to my keychain. But none of those worked. It started working only after editing the appropriate Provisioning Profile manually.

You could also trying removing all your available Provisioning Profiles and let Xcode create new ones for you. This will work too.

Mahesh
  • 520
  • 5
  • 3
15

I also had this issue, which turned out to be caused by an attempt to export for ad hoc deployment using a development provisioning profile instead of a distribution profile. It seems this is no longer supported in Xcode 6.1. Once I created an ad hoc profile and installed that the problem went away. A more useful error message would have saved me hours of work and would be greatly appreciated, Apple.

This thread was helpful:

xcode 6 beta 2 issue with exporting ipa "Your account already has a valid iOS distribution certificate"

Community
  • 1
  • 1
Troy Heere
  • 159
  • 2
11

Besides all the other answers, there's one more possibility after 2/15/2016: the old World Wide certificate expired and I guess everyone has already downloaded the new cert (or check this out). However, you'll be seeing this error if you haven't remove the expired one. You may need to choose View -> Show Expired Certificates to unhide expired certs. If the error is still there, try regenerate provisioning profile as advised by the others.

superarts.org
  • 6,508
  • 1
  • 53
  • 43
  • 2
    Also, note that you need to go down the line on the "Keychains" section on the upper left. After hitting my head against the wall a few times I found an additional expired cert underneath the "System" Keychain. – pir800 Feb 17 '16 at 08:20
8

I was moving to new Mac when I faced this issue. On your older Mac:

  1. Go Preferences > Accounts > Select Account > Details.
  2. In the dropdown right click on iOS Distribution (or whatever is the name of your distribution certificate).
  3. Export...
  4. Set a password for the .p12 file.
  5. Move and install this .p12 in the new mac.
  6. Try Again.
Ayush Goel
  • 3,086
  • 25
  • 35
4

Another possible cause for the problem (at least in my case) was that in my Keychain Access, I had two certificates for the team I was working with. One was expired, and the other one was the one I wanted to use. Deleting the expired certificate in Keychain Access solved the issue.

Darvish Kamalia
  • 817
  • 1
  • 7
  • 19
3

I ran into this problem, and I wanted to avoid screwing up my push notifications.

The easy fix for me was to just go to developer.apple.com > project > certifications, ids, and profiles > profiles > create a new profile (for development or distribution)

Download the created profile, drag and drop the profile over the Xcode icon, and then in your project target, set the new profile as the provisioning profile.

This fixed my problem--it may provide further help in the future.

Peter Kaminski
  • 782
  • 11
  • 20
2

The error message could mean that you need to get the Distribution certificate and private key from the developer who created them.

This can happen if some other team member has pressed the enticing "Reset" button (which means revoke certificate and create a new one). Here is a picture what the revoked certificate looks like:

picture showing the revoked cert message

You can export the valid certificate from the developer who created it and import it to other team members keychains.

  • Go to "Keychain Access" app.
  • Click on the "Login" in the top left box
  • Click on the "Certificates" on the bottom left box
  • Check which team member has the valid certificate:
    • when clicking on the "iPhone Distribution" certificate
    • everyone else sees "This certificate is revoked" in red at the top.
      • (Maybe backup the deleted certificate to avoid doing anything irreversible)
      • delete the revoked certificates
  • Export the one valid certificate and distribute to team
  • Import the certificate file for everyone else
Peter Lamberg
  • 6,659
  • 3
  • 48
  • 63
1

Today I was solve problem by delete from keychain old certificate Apple Worldwide Developer Relations Certification Authority and install new one (exp. in 2023)

theWalker
  • 2,004
  • 1
  • 17
  • 26
1

I'll add to here because while the accepted answer got me on the right track it wasn't the solution. There was a second (automatically created by Xcode) distro cert which I revoked. After doing that a new error came up. ("An App ID with Identifier '' is not available"... it also wasn't helpful) Eventually this lead me to the fact that my App Id in the member portal didn't have entitlements matching the build.

Anthony
  • 2,867
  • 1
  • 15
  • 17
1

I solved this issue by editing the provisioning profile in the member center which is used in my app and re-install the provisioning profile.

Ramakrishna
  • 643
  • 6
  • 21
1

I recently changed computer. The reason for me was that I had several developer certificates in the Apple Developer member portal. The solution was :

  • Go to Apple Developer Portal
  • Go Under Certificates -> Production
  • Click on "Revoke" for the oldest certificates and keep the most recent one

Revoking certificates won´t affect your Apple Store apps :).

Ugo Marinelli
  • 635
  • 10
  • 14
  • `Revoking certificates won´t affect your Apple Store apps`, but they say: `Revoking this certificate will invalidate it and any related services or provisioning profiles that use this certificate may be affected`. So I don't recommend this solution. – Ionut Sep 08 '17 at 06:33
0

I had this happen to me when I accidentally reset the certificate on another mac. Here's my scenario.

Mac1 - Had working certificate.

Mac2 - I accidentally reset the iOS distribution certificate

Mac1 stopped working and I get the message "Your account already has a valid distribution certificate"

The fix was

  • On Mac2, Keychain access -> certificates -> iOS Distribution certificate (for you/your company) -> export to p12 file (it will ask you to set a password)

  • Copy the exported file to Mac1

  • On Mac1, Keychain access -> certificates -> iOS Distribution certificate (for you/your company) -> delete (this is the old one that does not work)

  • On Mac1, double click the p12 file (then enter your password).

You should see a new iOS distribution certificate (for you/your company) in the certificate section of Keychain access.

This fixed the issue for me on Mac1.

Shammi
  • 481
  • 5
  • 13
0

Got it solved by deleting the provisioning profile which is managed by Xcode (XC iOS Ad Hoc: *) from the member center

san
  • 285
  • 2
  • 18