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

StackOverflow https://stackoverflow.com/questions/9359239

Question

I m stuck with this error:

Code Sign error: Certificate identity 'iPhone Developer: My Name (xxx)' appears more than once in the keychain. The codesign tool requires there only be one.

I try to renew the build a new CSR, remove the old certificate, build a new one, again and again and again and this error is still present

in the keychain I dont see any duplicated certificate and if I remove the only one I can see in the keychain , Xcode complains that the certificate can't be found ...

Was it helpful?

Solution

Xcode 4.3 now searches all keychains for signing certificates but that is increasing the frequency of the build error:

Certificate identity (x) appears more than once in the keychain...

Apple's steps to resolve it are here: "How do I resolve the CodeSign error: Certificate identity appears more than once in the keychain?"

However, if you are affected by the keychain bug mentioned in the final note of that guide, following is a simpler and preferred solution to problem:

1) Keychain Access > Edit > Keychain List, uncheck "Shared" for the login keychain.

2) next, IF going back into the Keychain List you find the login keychain is still marked as Shared, create a backup of the following files and then remove them if they exist:

/Library/Preferences/com.apple.security-common.plist
~/Library/Preferences/com.apple.security.plist

3) Retry your build.

OTHER TIPS

I've had the same issue after updating XCode to 4.3. Deleting certificates and provisioning profiles didn't change anything. There were no duplicates or expired ones anyway.

It turned out the problem was that my private key was in both the session and the system keychains in the keychain access. I just had to remove it from the system keychain and i could build my projects again.

I've had the same issue and I fixed it deleting every certificate from my keychain, every provisioning from my Xcode and every provisioning profile from my device and later... redone it again. I guess, It normally happens when you are working with differents profiles and you have created many certificates for the same provisioning.

I've had the same issue as well. I think you can get to this state in a variety of ways, but for me, it was because a certificate had recently expired.
What I didn't realize was that Keychain Access will hide expired certificates. Go under "View" and make sure you're not hiding the duplicate certificate.

If you already deleted all other Developer Certificates in your KeyChain and the Error is still coming up, then try to delete all old/unused keys (private key) with your name. The one that's necessary, is the one with the little "folder-enhancer-icon" next to its name. Keeping this and deleting the rest fixed it for me.

I had the same problem. I checked every related question I could find on SO and followed the steps - but had no luck. It kept telling me that my distribution cert appeared more than once, but I could see that it only appeared once. I revoked certificates and closed X-Code many times, but it turned out that there was a 'hidden' certificate. I had an older Distribution Certificate that was not in the login keychain. It was in an unnamed keychain. When I deleted that one, it worked! So its worth looking around keychain access thoroughly!

After moving to a new development mac, I had this problem. I tried deleting the duplicates and checking that there were no hidden expired ones, but the error persisted. The solution that worked for me was to copy the keychain pair from the old mac and imported it in the new mac. The problem was then solved with the following:

  • select the certificate in Keychain Access
  • Expand the arrow to see the private key
  • Double click the private key
  • Click Access Control
  • Choose 'Allow all applications to use this item'
  • Click Save Changes

For me, I was then able to rebuild the app successfully.

Hope that helps someone :-)

This works sometimes for me:

  • Delete all duplicates that you can see from the keychain (normally this step on itself does not help me)
  • Then also delete (or at least temporarily rename/move ~/Library/Developer/Xcode folder. Xcode keeps old crap/cache in there. I guess profiles exist there. Waste em. (Note that the path of this folder is changeable in Xcode prefs so if you changed the path, go there and delete stuff instead.)

Then rebuild. Worked for me this minute after getting this error the millionth time.

Try to remove certificates from the xcode organizer.

Solution:

In keychain: I’ve found that if you switch to the “All Items” view, on the left hand side, the deletion seems to work every time. But maybe that was just blind luck. Even if it fails, the act of switching back and forth between “All Items” and “My Certificates” seems to force KA to refresh the view, and tells you if the delete has “worked” yet:

link:

http://viggnesh.com/blog/problem-faced/

I had this issue with XCODE 4.5, because Organizer was still keeping the developer certificates.

  • Deleted all provisioning profiles from Organizer
  • Deleted all developer certificates from KeyChain--Also show the expired list
  • Close XCode
  • Download dev certificate
  • Install Provisioning profiles
  • Clean build
  • Check organizer certificate list and make sure you got one
  • Check Keychain to make sure you got one certificate
  • Archive

Fixed it by Organizer -> Teams (select Your Team) -> Refresh (low right corner).

I deleted every certificates and provisioning profiles and restart the system and add it again, it worked.

Just move the other cer. from "login" to "system" ... and dont delete it... Trust me

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top