The identity ‘iPhone Developer: Foo’ doesn’t match any valid certificate/private key pair in the default keychain

Great title, eh? Surprise: this is another entry in stupid stupid stupid, and like the previous one, this too is brought to you by Apple.

The problem and symptoms: you’re trying to rebuild an iPhone app that another developer worked on in the past. <– important.

Let’s say the other developer’s name is “Bert Fiddlesticks”. When you build your app in Xcode you get a build failure with a message like this:

The identity ‘iPhone Developer: Bert Fiddlesticks’ doesn’t match any valid certificate/private key pair in the default keychain.

Workarounds:

First check this great page of workarounds on fixing iPhone code signing errors. It’s way better than Apple’s developer support pages on this same topic.
You’re back? Sorry that didn’t work out for you. Great page though, eh? Hopefully you tried changing the code signing entries in your project settings to get rid of Bert’s name. Me too. No joy.

Here’s what I ended up doing:

  1. Find the project folder on disk.
  2. Open the .pbxproj file with a text editor.
  3. Search for Bert’s name. If you find it, e.g. in the code signing info section, delete everything between the quotes.
  4. Save and close the .pbxproj file.
  5. Restart xcode.
  6. Go to project settings and change the code signing entries to your own name. Do this even if you already did it earlier.
  7. Build clean and rejoice, for all should now be well.
In my case the pbxproj file had a line like this:
  "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Bert Fiddlesticks (ABC1232)";

I changed it to look like this:

  "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
Child’s play.
Elapsed time for you: 10 minutes. Elapsed time for me: 3 hours.

Fixing duplicate “login” keychains on a MacBook

Once in a while I run into silly problems — typically, software-related problems — that soak up a great deal of time. In the hopes of saving someone else pain and aggravation I’ve dedicated a blog category called “stupid stupid stupid” to these topics, and I’ll document them along with workarounds. Forthwith:

I use the Keychain Access app on my Macbook to store security certificates, passwords, and the like. A few months ago I noticed that I have two keychains called “login”. I donned my peril-sensitive sunglasses and managed to avoid thinking about it any further until yesterday, international “revive a moribund iPhone app development project” day, when I was forced to emerge from my peril-free state of blissful ignorance.

The problem: if you have two keychains called “login”, installing and using the development and deployment certificates required for iPhone app development becomes impossible. You download the certificates, install them in Keychain, and then try to develop with Xcode, but Xcode keeps failing to build or deploy with mysterious errors. This is because it can’t find the certs.

Workaround:

  1. Caveat Emptor: following these instructions blindly might screw you up. Use at your own risk. Backing up first would be smart. Don’t run with scissors.
  2. Open Keychain Access.
  3. Run Keychain First Aid from the Keychain Access menu. If this fixes it for you, great, it’s your lucky day.
  4. Select one of the keychains, click File > Delete Keychain “login”, and select “delete references only”. This fixed it for me… only one login keychain now.
  5. Delete and re-install the iPhone certificates, restart Xcode, and you should be good to go.

See also:

http://discussions.apple.com/thread.jspa?threadID=1480793

http://macosx.com/forums/archive/t-295133.html

Back to blogging…

It’s been ages since I blogged here on MyOwnPirateRadio. Now that 5 Blocks Out is off the ground I intend to post a bit more here, and on my Twitter account, and on the 5 Blocks Out blog.

You’ll be happy to know, dear reader*, that MyOwnPirateRadio topics will stay just as obscure as they’ve always been.

With that out of the way, let the games begin.

* is there more than one of you? I’ll play it safe and keep this singular.

Follow

Get every new post delivered to your Inbox.

Join 348 other followers