Why does Xcode auto-install a (duplicate and expired) certificate in the keychain?

12,404

Solution 1

I had the same experience with XCode 3 (not 4) and removing the old certificate in Keychain only wouldn't work.

I also add to remove all of my old provisioning profiles using the old certificate with Organizer then quit XCode, remove the old certificate from Keychain and restart XCode.

Now it seems to work fine!

Solution 2

You might want to try the solution from xCode 4 -reinstalls keychain certs that I delete

Kind regards, Frank

Solution 3

Not sure what's causing this for you, but two things to try out:

Firstly ... Xcode has historically had some bugs in this area that are only cured by quitting Xcode, deleting stuff from keychain, rebooting OS X (really - no idea what's in XCode that can survive an app restart, but I've seen it happen), and then restarting XCode. I haven't seen any of those for well over a year, but could be a regression bug?

Secondly ... although it doesn't handle certs, if you're not already you should be using iPhone Configuration Utility (http://support.apple.com/kb/dl851) for the provisioning profiles part if possible - it often provides manual fixes for Xcode bugs in this area.

Oh, thirdly (nobody expects the spanish inquisition): if you check Console, it sometimes contains extra debugging / error info for the commandline tools in Xcode that deal with certs and cert-signing (including error messages that appear nowhere else)

Share:
12,404

Related videos on Youtube

Tom Pace
Author by

Tom Pace

Updated on July 07, 2020

Comments

  • Tom Pace
    Tom Pace almost 4 years

    Possible Duplicate:
    xCode 4 -reinstalls keychain certs that I delete

    The question says it all in a nutshell.

    When building a project in Xcode, I receive the error message from the Check dependencies step:

    CodeSign error: Certificate identity 'iPhone Developer: xxxxx' appears more than once in the keychain. The codesign tool requires there only be one.
    

    Problem is, this certificate identity is reinstalled whenever Xcode is launched. It is an expired certificate too, that causes extra confusion. So I delete it in keychain, and build the project and everything works.

    Quit Xcode, restart, watching Keychain, and TA-DA! the expired certificate reappears.

    I feel like I'm back on a virus-infected windows machine.

    Since the project builds and executes properly when the cert is deleted, the only problem is the automatic installation xcode does.


    Edit:

    I think it's got to be related to an examination that xcode does of the keychain, for whatever reason. Then xcode decides to install the cert based on its checkup of keychain, though it's a faulty decision. I could probably solve this problem if I spent 24-48 hours, but I'm able to keep working, without quitting Xcode. :)

  • Abhi Beckert
    Abhi Beckert over 11 years
    THANK YOU! A restart after deleting everything, then manually re-installing certificates (I don't trust/didn't try the auto install) did the trick. There are clearly still provisioning bugs in Xcode 4.3.1.
  • Pyro2927
    Pyro2927 over 11 years
    You rock! This worked for me :)
  • LetBulletFlies
    LetBulletFlies over 11 years
    Thank you very much! Save me from frustrating open/close actions.
  • Ranganatha G V
    Ranganatha G V about 7 years
    After deleting other certificates and private keys it works for me also! But I wanted to know how to avoid Xcode to download these certificates automatically, because this problem appears after sometime again!