EricHolsinger.com

Icon

This is where you get the spin on Eric Holsinger.

Xcode codesign failed with exit code 1; expired certificates causing ambiguous matches

If you work with Xcode code signing long enough you’ll run into an error like this:

/usr/bin/codesign failed with exit code 1

If you view the build results (Build->Build Results), and expand the error message (there is a little paragraph button on the right-hand side of the line) you may see something like this:

iPhone Developer: Firstname Lastname (hashcode): ambiguous (matches "iPhone Developer: Firstname Lastname (hashcode)" in /Library/Keychains/System.keychain and "iPhone Developer: Firstname Lastname (hashcode)" in /Users/username/Library/Keychains/login.keychain)
Command /usr/bin/codesign failed with exit code 1

You have two certificates, with the same unique identifiers. One is in your login keychain and the other is in your system keychain. The real problem is, you probably have an expired certificate conflicting with your active certificate.

See my video explaining how to fix Xcode codesign failed with exit code 1; expired certificates causing ambiguous matches. You can also follow along with the screenshots below.

You wouldn’t know it when viewing the Keychain Access app. When you view your login certificates it will probably look like everything is fine. Open Applications->Utilities->Keychain Access. Then select the login keychain and Certificates category. Everything will probably look fine.

Keychain login certificates

And when you view your system certificates, there won’t be anything there either. Select the System keychain and Certificates category.

Keychain system certificates with expired hidden

You have to show expired certificates. For some reason, this isn’t on by default. From the menu, choose View->Show Expired Certificates.

Keychain system show expired certificates

Then you will see the offending certificate with an onerous red x circle.

Keychain system with expired certificates visible

Just delete the old certificate and build again.

Keychain system delete expired certificate

I hope this saves someone some time.

More information:

If you enjoyed this post, make sure you subscribe to my RSS feed!

 

 

Disclosure: All of the products and services discussed on this site were purchased by myself, unless otherwise noted. Affiliate links are sometimes included in the posts. I generally don't get freebies to review or get paid to review things (outside of affiliate links). If I get it for free, I'll tell you. Material compensation does not influence my opinion and my views are my own.

 

Category: Programming

Tagged: , , , ,

Viewed:6,448

25 Responses

  1. Thank you so much. I’ve been trying for hours to fix this issue, jumping through all kinds of hoops, deleting and re-downloading certificates, manually editing project files… and this was it.

    Why viewing expired certificates is only turned off be default in the System view of Keychain is beyond me. Uggh.

  2. That’s exactly what happened to me, too. I’m really glad it helped to share this information. It seems like the expired certs should get extra visibility, not less.

  3. Art says:

    THANKS TO YOU!!! I was going crazy trying to figure out what was wrong. You saved my monitor from any more verbal abuse… for the moment. :)

  4. Jay says:

    Thank you SOOOOOO much!!! I have been cursing Apple for hours now lol. I even made a new project called F*** Y** Apple thinking it was a corrupted project :) It all works now!

  5. DP says:

    Thanks a lot for these steps. The view Show Expired Certs fixed my issue. I could have never figured that out..

    Thanks

  6. Scot says:

    THANKS! you solved my issue too!

  7. Joseph Beckenbach says:

    Thanks for the tip here! This head-scratcher was threatening to make me turn myself bald before my time. =)

  8. Manjyn says:

    Thank you very very very very much.

  9. Splatt says:

    Thank you!

  10. dan says:

    THANKS!!

  11. Don says:

    Thanks so very much. Spent hours++ trying to figure this one out!

  12. I’m glad to help you guys out. It was such a pain when I was trying to find the problem myself.

  13. David says:

    Thank you!!

  14. Jim says:

    Now I understand! Thanks for all of the effort!

  15. LIN says:

    thank you very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very MUCH

  16. Blamdarot says:

    Thank you!

  17. Peter Oppenheimer says:

    Me too. Thanks.

  18. Marc says:

    Thank you, this is the solution for me with a Appcelerator project.

  19. Zwelfe says:

    Thank you a lot… the trick was really to delete the old certificate in the system section…

  20. That’s right. I’m glad I could help you find it. It’s silly that it’s not more obvious.

  21. Hubert K says:

    FINALLY!!!! Thank you! ….Show Expired Certificates….

  22. Horst says:

    Thank you. One little missing option that can drive you crazy. ;-)

  23. Incredibly helpful! Thank you so much

  24. russt says:

    thanks so much, but I had another twist. The KeyChain Access utility wouldn’t let me delete any of the duplicate certificates in the System keychain.

    I finally got it to work by rebooting the machine. I tried quiting everything and disconnecting the device, but nothing worked. This was with xcode 4.2 on leopard.

    At any rate, I decided to reboot and that cleared the problem – I was then able to clear the duplicate certs and compile my app.

    It is possible that kicking /usr/sbin/securityd might have worked as well.

  25. Sam Yeung says:

    Excellent! This save me a lot!!!
    View->Show Expired Certificates is a key!

Leave a Reply

Contact Information

Eric Holsinger
Saco, ME 04072
ph: 207 . 749 . 1703
eM: eric.holsinger@gmail.com
My company: Whirlidoo, LLC

View Eric Holsinger's profile on LinkedIn

Categories

My Twitter noise...

  • Sencha Touch had been slick, but oddball things, like setting scrollable to false on a form panel to render it, cause me stress. 18 hrs ago
  • Google Drive? 2 days ago
  • Am I the only one who thinks coffee from a French press tastes like coffee with little tiny coffee grounds all over my tongue? 3 days ago
  • More updates...

Posting tweet...

Powered by Twitter Tools


Banner