Dinakar
Dinakar

Reputation: 1208

CodeSign Error while preparing App for distribution using Distribution certificate

I have created a Distribution certificate, & a Distribution Provisioning Profile for Ad-Hoc Distribution/ AppStore submission. I have made all the necessary changes in Info.plist, Entitlements file, Targets -> Build of the project. I'm getting an error. i've attached screen shot of this error.enter image description here

This error seems to be occurring coz I've no profiles currently matching for iphone distribution.. It displays 'profile doesn't match any valid certificate/ private key pair in default keychain'. I've checked the certificate & its valid. Can there be some issue with the private key present in the keychain access. If so the case, please suggest a solution.

Upvotes: 0

Views: 1335

Answers (3)

clawoo
clawoo

Reputation: 791

If you are unable to get the private key you are going to have to re-generate one. This will not affect in any way whatsoever already published applications, but will invalidate your current distribution certificate and provisioning profiles.

So, the steps you need to take are:

  1. Log in to the provisioning portal
  2. Go to Certificates, switch to Distribution tab
  3. Revoke the current certificate
  4. Open up Keychain Access on your Mac and create a new certificate signing request (plenty of resources on how to do that)
  5. Upload the CSR to the provisioning portal, wait for the server to process it
  6. Download the newly created certificate and install it (double click)
  7. Go to Provisioning, switch to distribution tab
  8. Generate your provisioning profile for AdHoc distribution, download it and install it

You can now use it to sign your application.

This would be an excellent time for you to backup your newly generated certificate. In Keychain Access go to Keys, right click your newly generated private key and export it as a p12 file. Store it somewhere safe.

Upvotes: 6

D25
D25

Reputation: 283

Make sure you have "Distribution Certificate" and not "Development Certificate" This you can get from provisioning portal under Certificates > Distribution.

Once you have added the certificate to the portal, download and add it to your keyChain.

Also make sure that you made the provision file under "Distribution Provisioning Profile" this can be done under provisioning>Distribution

Upvotes: 0

Vin
Vin

Reputation: 10548

You need to have the private key of the certificate present in your keychain. It is generally present on the system where the CSR(Certificate Signing Request) for the certificate is created first. If you have transferred the certificate from a different system, try exporting the private key as .p12 file(Identity export), rather than exporting the certificate alone.

Upvotes: 0

Related Questions