Xcode 6 beta 2 issue exporting .ipa: "Your account already has a valid iOS distribution certificate"

I've had the same issue two days ago. Turns out the problem was:

  1. I have my own developer distribution certificate with a proper private key
  2. I have enterprise developer distribution certificate of my client without a private key
  3. I try to make an enterprise distribution package for my client
  4. Xcode throws at me vague error: Your account already has a valid iOS distribution certificate

The solution is: get a private key for enterprise account of my client. There are 2 possible options:

  1. Ask you client for credentials to access his enterprise developer account on Apple website. Revoke old certificate and recreate it. You'll create the private key in the process. BEWARE: revoking an enterprise distribution certificate invalidates all apps that were signed and deployed with that certificate (official info).
  2. Ask your client to export his private key from his Keychain Access application as a *.p12 file and send it to you with a password. You can't download the existing private key from the Apple website. The only way to get it is to ask your client. I did it and it and I was able to finally make the package.

How to find out if you have a private key for a certificate: Open Keychain Access application. Choose certificates. Find your certificate. If you see small grey triangle on the left side of the certificate, open it and you see your private key. No triangle = no private key.

How to find if you have a private key for certificate


This is what worked for me.

  1. On my machine I kept both Xcode 5 and Xcode 6 beta.

  2. From Xcode 6 beta, Archive the project. Close Xcode 6.

  3. Open Xcode 5, go to Organizer and export as Ad Hoc build with proper provisioning profile.

That's it!


I had the same problem, I had to use the command line "xcodebuild" tool as a workaround, with only Xcode 6 installed (didn't have to re-install Xcode 5).

http://www.thecave.com/2014/09/16/using-xcodebuild-to-export-a-ipa-from-an-archive/

Example:

xcodebuild -exportArchive -archivePath $projectname.xcarchive -exportPath $projectname -exportFormat ipa -exportProvisioningProfile "Provisioning Profile Name"

Tags:

Ios

Iphone

Xcode6