Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ios

iphone

xcode6

People also ask

How do I use iOS distribution certificate?

Preparing the iOS Distribution CertificateSign in to your Apple Developer account and navigate to Certificates, IDs & Profiles > Certificates > Production. Add a new certificate. Set up a certificate of type Production and activate App Store and Ad Hoc. Click Continue.


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"

In my case, what solved the problem was deleting all Distribution Certificates from my Apple Developer Account. Then, Xcode managed to create development and distribution certificates again, and that did the trick.


I get a solution without renew the certificate:

1 - Archive the target with the appropiate Code Signing Identity and Provisioning Profile

2 - Right button in the created file in Organizer --> Show in Finder

3 - Right button in the xcarchive file --> Show package content

4 - There, in Finder, go to Products/Applications/

5 - Upload the file Products/Applications/appName to iTunes

6 - When the app appear in iTunes, right click on it --> Show in Finder. This is the ipa file

7 - Send this ipa through App Loader 3.0

I dont think that it is a lasting solution but do not want to delete my certificates


FINALLY SOLVED IT!!

1) Create a NEW production certificate through developer.apple.com which requires you to use Keychain Access to create a new private key on your computer

2) In the same developer portal, open your distribution Provisioning Profile used with this app and select the new production certificate which you just created. Generate the provision then download it and run it

3) Run your app, Archive it, then export the archive.

viola

This took me days if not weeks to figure out, I hope it helps you.


Create new iOS Distributon Certificate and choose Production> App Store & AdHoc section. Also don't forget to change Target>Build Settings> Code Signing all to iOS Distribution.(but after created ipa set it back to iOS Developer) Only this solved my problem.