How do I fix code sign code 1 & unable to build chain?

Trying to build .iOS in Xamarin using Build/Iphone. Getting this error so it won't build.

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(3,3): Error: /usr/bin/codesign exited with code 1 (AnimalGames.iOS) /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(3,3): Error: Failed to codesign 'bin/iPhone/Release/AnimalGames.iOS.app': Warning: unable to build chain to self-signed root for signer "Apple Distribution: Bruce Krueger (S7PPS4GQZT)" /Users/gamesbypapa/Documents/AnimalGames/AnimalGames/AnimalGames/AnimalGames.iOS/bin/iPhone/Release/AnimalGames.iOS.app: errSecInternalComponent

     (AnimalGames.iOS)

Accepted Reply

There are two common causes of this:

  • A missing intermediate certificate

  • Customised trust settings


For the first, see Developer > Support > Apple Worldwide Developer Relations Intermediate Certificate. If you are missing the intermediate, you can get it from the Apple PKI page.


For the second, run Keychain Access and find all the certificates in the chain from the leaf (Apple Distribution: Bruce Krueger (S7PPS4GQZT)) to the root. For each one:

  1. Double click the certificate to open it in a window.

  2. Disclose the Trust section.

  3. Make sure that all the popups are set to their default values (Use System defaults for the first, “no value specified” for the rest).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • Adding the missing intermediate certificate allowed me to build the file and archive it. When I try to sign and distribute to Apps connect, it gives me Authorization Failed with no information on the screen as to why. What do I try next?

  • I performed the tasks for both of the causes listed above and still am unable to get codesign to sign the file. I receive the following error:

    Warning: unable to build chain to self-signed root for signer "John Boyes" /usr/local/Cellar/php@7.3/7.3.25_1/lib/httpd/modules/libphp7.so: errSecInternalComponent

Add a Comment

Replies

There are two common causes of this:

  • A missing intermediate certificate

  • Customised trust settings


For the first, see Developer > Support > Apple Worldwide Developer Relations Intermediate Certificate. If you are missing the intermediate, you can get it from the Apple PKI page.


For the second, run Keychain Access and find all the certificates in the chain from the leaf (Apple Distribution: Bruce Krueger (S7PPS4GQZT)) to the root. For each one:

  1. Double click the certificate to open it in a window.

  2. Disclose the Trust section.

  3. Make sure that all the popups are set to their default values (Use System defaults for the first, “no value specified” for the rest).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • Adding the missing intermediate certificate allowed me to build the file and archive it. When I try to sign and distribute to Apps connect, it gives me Authorization Failed with no information on the screen as to why. What do I try next?

  • I performed the tasks for both of the causes listed above and still am unable to get codesign to sign the file. I receive the following error:

    Warning: unable to build chain to self-signed root for signer "John Boyes" /usr/local/Cellar/php@7.3/7.3.25_1/lib/httpd/modules/libphp7.so: errSecInternalComponent

Add a Comment

Adding the missing intermediate certificate allowed me to build the file and archive it.

Yay!

When I try to sign and distribute to Apps connect, it gives me Authorization Failed with no information on the screen as to why. What do I try next?

It’s probably best to start a new thread for this.

If you’re using the Xcode organiser to do this, tag it with Organizer Window so that I see it.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"