Command CodeSign failed with a nonzero exit code

After Upgrading to Xcode 13 my Builds are failing with Command CodeSign failed with a nonzero exit code.

My app is in version 3.4.4. While trying to build version 3.4.5 for Mac we have started to get this error: Command CodeSign failed with a nonzero exit code Have tried everything people have said in this and other forums:

  1. Clean build folder; Restart Xcode
  2. Add --deep to Other Code Signing Flags
  3. Revalidate all Certificates
  4. Manual and Auto Signing

The unsigned executable works fine. I am Evan able to Sign it manually and distribute locally.

For Store Submission we need this step to succeed.

Will appreciate help from Apple Technical Support

This started happening with Xcode 13.

Will appreciate help from Apple Technical Support

To be clear, DevForums is not a formal support channel. I do what I can to help out here but, if you want formal support, open a DTS tech support incident. [He writes, about 15 minutes before downing tools to head out on vacation.]

Add --deep to Other Code Signing Flags

Do not do that. See --deep Considered Harmful for an explanation as to why not.

It sound like you’re using Xcode to build an app for the Mac App Store. Is that correct? If so, do you have any specific requirement to use manual signing? If not, I recommend that you adopt automatic signing as follows:

  1. Remove any extraneous code signing build settings.

  2. In Signing & Capabilities, enable “Automatically manage signing”.

  3. Set the Team popup to your team.

  4. Set Signing Certificate to Development.

Does that work? If not, create a small test app from one of the built in templates and check whether that setup works there. If it does, you know the problem is specific to your main app. If it doesn’t, you know you have a general code signing issue.

Share and Enjoy

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

In my case, this was caused because I copy the project from another macbook, and somehow it brought together some certificates, and building the project xcode was crashing with this error, so I clone the project again from the git, and all works fine.

I was using the same developer certificate for 2 teams. It was producing the "Command CodeSign failed with a nonzero exit code" error without any logs or any other kind of information on both projects (strangely only when deploying on specific devices). After creating a developer certificate for each team everything works fine.

Hello,

Command CodeSign failed with a nonzero exit code All the above mentioned points (1-4) were set correctly. Nonetheless, the problem didn't vanish.

Next I removed all breakpoints (about 100). Next: Clean Build Folder… Next: Build The problem was gone.

Best regards, Gerhard

Like many Xcode defects, this has been around for a while. If you are reading this now, consider yourself lucky you have not hit this before.

See Stack Overflow for more bread crumbs, unfortunately no root cause hence no reliable workaround yet.

https://stackoverflow.com/questions/52421999/xcode-10-command-codesign-failed-with-a-nonzero-exit-code

Command CodeSign failed with a nonzero exit code
 
 
Q