I have the following error:
Command /usr/bin/codesign failed with exit code 1
Here is what I already did for trying to fix this:
Feel the need to share this, even though it's ridiculous.
I'd set up a second developer account on my Mac and couldn't codesign anything. The error was "the user cancelled the operation".
A simple reboot fixed this for me.