Warning: unable to build chain to self-signed root for signer "Mac Developer: Dylan M (*******)"

I keep getting this Warning each time I test:


Warning: unable to build chain to self-signed root for signer "Mac Developer: Dylan M (*******)"


I have no Idea what it means and couldn't find any other case of it on the internet, could anyone help?

Post not yet marked as solved Up vote post of DylanM Down vote post of DylanM
109k views
  • FYI, I had to create a new test project in Xcode and debug against the iPhone in order to get around the issue.

Add a Comment

Replies

@honey9 It works like a charm, thank you!
After days of struggling, finally found the solution! 🎉🎊

Since this forum is not convenient I've posted it here on the stackoverflow

Hope it helps
Add a Comment

I met this error as well and found a solution online which solved it.

****The key issue here is the root certificate. ****

  1. Delete all root certificate ("Apple Worldwide Developer Relations Certification Authority") from your Keychain Access. Click certificates and delete it from both LOGIN & SYSTEM (If both area have this certificate)

  2. Then download the latest cert through link below, and double click to add to keychain

https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer

Make sure it is in your Keychain's SYSTEM and you ONLY have ONE root certificate in your Keychain's SYSTEM area, NOT in LOGIN area.

  • Very good this worked for me, after a lot of searching! Tks!!

  • worked like charm @kaneSheng thank you brother

  • I tried every other suggestion on here and StackOverflow and this is the only thing that worked - you saved my life today - thank you so much!

@FrostyBagg

This works! thank you

For people who encounter the following error, PLEASE check the bold keywords to make sure it's the same problem

Code Signing /Users/***/Library/Developer/Xcode/DerivedData/Zuzu-halnevgbwzzefabntoduqfddqjay/Build/Products/Debug-iphoneos/YYY.app/Frameworks/ZZZZ.framework with Identity Apple Development: XXXXXX (YYYYYY) /usr/bin/codesign --force --sign 782277B24E70444CAB5460500BBC7ACCD0AEE368 --preserve-metadata=identifier,entitlements '/Users/pai/Library/Developer/Xcode/DerivedData/Zuzu-halnevgbwzzefabntoduqfddqjay/Build/Products/Debug-iphoneos/YYY.app/Frameworks/ZZZZ.framework' Warning: unable to build chain to self-signed root for signer "Apple Development: XXXXXX (YYYYYY)" /Users/pai/Library/Developer/Xcode/DerivedData/YYY-halnevgbwzzefabntoduqfddqjay/Build/Products/Debug-iphoneos/YYY.app/Frameworks/ZZZZ.framework: errSecInternalComponent Command PhaseScriptExecution failed with a nonzero exit code

@honey9 thanks for the pointer. In my case xcode some how screwed up access to my certificates and I had to manually go into keychain and set access to allow all, which fixed the issue.

It might help others with the same issue.

@honey9 your solution worked for me. Thanks a lot! Xcode 12.5.1 and XCode 13

@FrostyBagg this is the only solution in my Xamarin Project. Thank you.

  • yes that works for Xamarin. I wish that it was documented better

Add a Comment

You may have an expired cert.

  • Open Keychain Access
  • In Search filter enter certificate name ("Mac Developer: Dylan M (*******)")
  • If there's a matching expired cert, then delete it
  • There may now be just one valid cert matching - so retry the build
  • If needed go create new certificate

I was facing the same issue, I resolve it by adding the "Worldwide Developer Relations" intermediate certificat that match my code signing certificate. To find which "Worldwide Developer Relations" match you certificate, in keychain show up your code signing certificat details in the "Issuer Name" section identify the "Common Name" and the "Organizational Unit". Them download and install the corresponding certificat from https://www.apple.com/certificateauthority/

  • Yessss Thank you @ibamba - in my case, I had a "Developer ID Application" certificate, and I needed to download "Developer ID - G2 (Expiring 09/17/2031 00:00:00 UTC)" from that website.

Add a Comment

2022 update: @honey9 this solution still works.

That's the way I fixed it:

  1. Go to keychain, find develop cert. It was marked as "unreliable".
  2. Change to Trust and back to Use defaults. It become marked with green checkmark again.
  3. Build and run Xcode project.

This issue has been happening to me sporadically since Apple renewed one of the intermediary CAs involved in developer certs. At first I was fixing it by removing and regenerating certificates, it turns out the simplest way to fix the problem is to just reboot, and everything works again.

Putting this here as an option for people to try before they start destroying their work environment / needlessly complicating their keychain settings where a reboot may also 'fix' things for you (at least for a couple of weeks at a time if you never shutdown/reboot otherwise).

Following some @plasticbrain tips I solved it with only those 2 steps:

  1. Opening Keychain Access and deleting all my expired certificates.
  2. Opening Xcode and then on "Preferences > Accounts", selecting "Download Manual Profiles".

rm -rf Users/yourUserFolder/Library/Developer/Xcode/DerivedData/* None of the above answers worked for me, this one saved me