I just started seeing this problem this morning after installing another iPhone Developer cert (one for myself that I've had and now another for the company I work for). I'm wondering if it is trying to find the cert by name (which is the same for each, since both dev program registrations were under the same name) and is finding the wrong one. Unfortunately I don't have a fix yet...
I'm in the same situation than you.
I'm going to try to export the private key from the other computer.
Cf. ADC
It is critical that you save your private key somewhere safe in the event that you need to develop on multiple computers or decide to reinstall your system OS. Without your private key, you will be unable to sign binaries in Xcode and test your application on any Apple device. When a CSR is generated, the Keychain Access application creates a private key on your login keychain. This private key is tied to your user account and cannot be reproduced if lost due to an OS reinstall. If you plan to do development and testing on multiple systems, you will need to import your private key onto all of the systems you’ll be doing work on.
So far the only thing I can find is to backup and remove one of the developer certs at a time (and then I'll have to switch between them when I change projects). I'd love to know if you find any other options.
I had a similar sort of problem that was cleared up by going to 2.2. When I tried to compile XCode gave an error indicating that I an ambiguous cert.
Do a search for files called 'login.keychains' (in User/X/Library/Keychains on my machine where X is my user name)
and 'system.keychains' (in /X/Library/KeyChains).
You can see the contents by opening with KeyChain access. I found I had a duplicate developer cert in there and when I removed it everything started to work. Its only when I went to 2.2 that XCode identified this.
Might not be related but certainly worth checking out.
Certificates and code signing seems to be much better in 2.2 atleast in my case.
I'm using SDK 2.2. This problem was introduced when I installed a 2nd developer cert, but they are different. One is for my personal enrollment, the other is for my enrollment under the company I work for, so each cert is needed for a different reason, but they are generated with the same name. My assumption at this point is that this is the cause and the tools don't account for this situation. I have an email into Apple to see if they have any resolution to this, or if I just need to remove the one that I'm not currently using in order to make it work each time I switch between using different certs.
gtur - do you have 2 (different or the same) developer certs in your keychain? if they are the same, remove one of them (make sure you have the public and private key in the one you keep - backup anything you remove before removing it or you'll have to generate a new one and start that process over). if they are different (like the case that I've described above), you will need to remove the one that you are not trying to use and switch back when you want to use the other - that is the bug that I've tried to contact Apple about; with no success so far.
FYI, I was hoping from the release notes of the 2.2.1 sdk that this was fixed in xcode as well, but it is still broken. back to manually adding/removing certs to switch between profiles for now...
Attention everyone! I had the same issue but I resolved it using 2 steps. I don't know why this worked, but its what helped me:
1. The name of my certificate versus the name of my key were slightly different (i used nickname for my key). I changed the key (both private and public) to the same name as on my certificate. For example if your certificate is Jonnathan Lastname, make sure your key is Jonnathan Lastname Dev Key (***don't use Jon Lastname Dev Key***)
2. I downloaded the latest version of the iPhone SDK. Quit Xcode, and installed it. After it has been installed, I opened Xcode, went to organizer and pluged in my itouch. It Worked!
This helped me solve the "A signing identity matching this profile could not be found in your keychain" problem. If you haven't done this yet, try it.
vlad12 - thanks for the feedback. Yes, that is the common solution for this error, but not for the case when the name matches but with two certs (work and personal, for example, as in my case). In this case the name does match, but there are two certs that match the same (correct) name, and Xcode can't determine which to use when attempting to sign (also showing the error in organizer) unless one of them (either one) is removed from the system. If anyone has solutions for this specific scenario, I would love to hear it. Thanks.
In my case, I needed to place my updated iPhone dev certificate into my Keychain (and remove my outdated one). Once that was done, the error disappeared.
Here's the Apple link with more info (must be logged in as an iPhone dev to see it): iPhone Dev Center
Just wanted to post and let you know that I had exactly this problem myself recently, and after much messing around and head-scratching, managed to figure it out.
My problem was that I was exporting my private key, but the self-signed certificate I have used as the root certificate to create and sign my private key from was not being exported. So, I assume, when I imported my private key into my other development machine, the private key could not be verified, and therefore failed to work in XCode Organiser.
Exporting the self-signed root certificate as well as the private key fixed it for me.
Exporting the self-signed root certificate as well as the private key fixed it for me.
Maybe I'm missing something, but it seems like that doesn't work for me... I tried it on both machines, exporting the certificate and key from both sides (private and work).
Can anyone else confirm that CraigP's approach works for them?
It depends on the problem that you're trying to solve. The error message at the top of this thread has multiple scenarios that can lead to it. My case (which matt55 has confirmed is the same as his) involves 2 different certificates causing a name ambiguity that Xcode can't handle. This situation is not resolved by any of the suggestions in this thread and is still pending. The only "solution" that I've been able to find so far is to back up your certificates (private and public for each account) and then only have the one that you want to compile against in your keychain. When you want to switch, delete the cert from the keychain and then install the other one. This is a bit of a pain, but the only solution that I have at this point (this could be scripted with /usr/bin/security, but given the context and the passwords involved, etc, it is probably easier to do it in the Keychain Access GUI).