Why does Xcode auto-install a (duplicate and expired) certificate in the keychain? [duplicate]
Asked Answered
D

5

27

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. :)

Donegan answered 17/3, 2011 at 7:2 Comment(0)
C
22

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!

Conformal answered 11/7, 2011 at 7:41 Comment(3)
You rock! This worked for me :)Faradmeter
Thank you very much! Save me from frustrating open/close actions.Barred
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!Tehee
G
4

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

Kind regards, Frank

Glendaglenden answered 19/3, 2011 at 20:49 Comment(0)
L
1

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)

Lunn answered 18/3, 2011 at 15:0 Comment(1)
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.Clemons
D
0

Delete all your provisioning profiles liked to the expired certificate from organizer.

Go to the provisioning portal create the new certificate. After that for each provisioning profile, edit them by selecting the certificate checkbox on the edit page and save them, then re-download the profiles.

Driskell answered 8/7, 2011 at 6:0 Comment(0)
M
0

For posterity, here's the strategy to get around this problem in our automated build script:

  1. Before building, move the ~/Library/MobileDevices/Provisioning Profiles directory aside
  2. Check to see if the iPhone Configuration Utility is running and close it (certs always reappear if this app is open. In XCode 4.1 you need to close the organizer too.)
  3. Run you build
  4. Move the Provisioning Profiles directory back
  5. Profit?
Merrill answered 9/9, 2011 at 13:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.