Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Sign Error: Certificate identity appears more than once in the keychain [duplicate]

Possible Duplicate:
Code Sign error: Certificate identity 'iPhone Developer: My Name (xxx)' appears more than once in the keychain

We have two different Developer accounts (one for store and one for enterprise). The enterprise account came later. Long Story

They are administered under two different email/accounts.

I am trying to allow one XCode project with two different targets to sign our app for either of the accounts based on whether im doing a store or enterprise build. The problem is I get the error message from the title.

They are separate certificates with different private keys so I dont understand why they cant coexist and why XCode cant tell them apart.

IS there any way I can have two different targets in XCode with these different certs/provision profiles?

Update: Per my comment i was able to sign the app for either target, but now when i got to produce an IPA, i get an error about ambiguous certificates from the two different keychains. Thanks!

like image 562
MobileGuy Avatar asked Mar 05 '12 14:03

MobileGuy


Video Answer


2 Answers

Here is what worked for me on Lion ver. 10.7.3 with XCode 4.3.1, and a lot less painful than rolling back to 4.2!

In Keychain Access, make sure your "View" menu > Show Expired Certificates option is turned ON.

Click the "Certificates" 'Category' and then click through every one of the keychains you have listed in your 'Keychain' sidebar in Keychain Access. If you see any duplicates, even expired certificates, delete those duplicates.

Click the "Keys" 'Category' in Keychain Access.

Navigate through every keychain looking for and deleting any "Orphaned Keys" that have the same Common Name as the affected certificate. Orphaned keys are ones that are not bound by a Disclosure Triangle to an iPhone Developer or iPhone Distribution certificate that currently exists in the keychain.

If you found and removed any extra keys or certificates, then re-attempt your build.

This worked for me after this point - but including the parts below from Apple in case it doesn't work for you.

If the issue persists after removing all active or expired duplicate certificates or keys by the same common name, you might try removing all existing signing certificates and keys and replace them with new ones using the steps in How do I delete/revoke my certificates and start over fresh?.

Finally, if the error persists even after creating new certificates, please control-click on the affected certificate in Keychain Access, choose "New Identity Preference" and click the 'Certificate' field.

If you see duplicate certificates listed in here, this is an known and uncommon issue with Keychain Access.

To work around the problem, try the following: Export your developer profile using the process in Transferring Your Identities. Create a new OS X User Account, install Xcode for the new user and import the developer profile created in the previous step.

like image 191
ciara staggs Avatar answered Sep 17 '22 12:09

ciara staggs


The same issue for me. After renew the certificates (Development and Distribution)

To solve it go to the keychain tool and follow the next steps

  1. View --> Show expired certificates
  2. Select KeyChain System
  3. Select Category All items

You should see some certificates expired, just remove it and rebuild.

hopefully helps

like image 24
Iván Peralta Avatar answered Sep 17 '22 12:09

Iván Peralta