Codesign error: Certificate identity appearing twice
CodeSign error: Certificate identity 'iPhone Developer: XXXX (12345678)' appears more than once in the keychain. The codesign tool requires there only be one.
So I go to my keychain and delete it. But I get this error every time I restart Xcode 4 and some app is adding the expired old certificate back into keychain. Any ideas why and which app?
I just had the same problem. It has been fixed. It came after I submitted an app and installed a few certificates to sign the app.
Quick Fix: Open up KEYCHAIN ACCESS > click on MY CERTIFICATES> in there you will probably see iPhone Developer: . You will probably see it TWICE! Select the one with the earliest Expiration date, right click and select DELETE.
Restart Xcode if you haven't. Works now. :)
Happy Coding.
I think I figured out why the simple delete is not working. Because the dev certificate is still stored in the provision profile, when I close/re-open the Xcode after deleting the certificate in Keychain, I saw the old certificate come back. So I delete it again. It worked.
The simple delete the profile solution did not work for me.
Solution that worked in my case:
- Quit Xcode
- If the Keychain access is open, keep it open.
- Launch Xcode now.
- See that the certificate Xcode was complaining about will be re-added into the keychain at launch from its cache.
- Go ahead and delete it.
- Compile and happy coding.
I just spent a fair amount of time struggling with this same issue. After all the attempts to fix it, I finally came to realize that it's a bug in Xcode. This post gave me a clue to fix it: certificates magically re appearing in your keychain
In my case, the matching private key was in the System keychain, and just had my name on it (hard to tell it was for provisioning). I had to:
- Move the associated private key to 'login' keychain
- Restarted Xcode and noticed that the private key was now showing as associated (confirms what it was for)
- Delete the cert and private key
- Restart Xcode and poof! It stopped adding my old cert
An interesting observation is that when you delete the certificate, it doesn't delete the associated private key. Visually, it shows the private key below the cert. Don't be fooled.
Good luck!