CodeSign fails on second and subsequent builds

My first clean build works fine and my entire project builds successfully and is signed for local debugging. If I make a change and run again, the build fails with error Command CodeSign failed with a nonzero exit code. Expanding to get the full error: the codesign_allocate helper tool cannot be found or used.

I found a link that described that some things can happen to code after it is signed (like stripping) that invalidate the signature after it has been created. However, I cannot find any setting that seems to affect this.

My project was migrated from an old version of Xcode running on an 2012 MacBook Pro (OS-X 10.10), and many settings in the project are out of date or invalid, and I'm guessing there is some setting that I can change to avoid whatever may be causing this, but I have absolutely no idea which setting it may be, and I cannot find any documentation on this particular error, or any indication why the error message is so useless or cryptic, and wonder how any build system could possibly fail after a successful first build with literally no other changes to code.

Thanks for any help anyone can provide.
I’ve seen this crop up when folks modify a signed Mach-O image in place and then try to re-sign it. See this thread for more background.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
CodeSign fails on second and subsequent builds
 
 
Q