Command CodeSign failed with a nonzero exit code with sonoma

After updating to sonoma and after updating xcode compiling of my program fails with this error:

Command CodeSign failed with a nonzero exit code

Can someone help me to to understand and fix it…? xcode doesn’t give me any other help …

Anyone has an idea of what I could check? I cannot find a solution …

Did you look into the build log (right button in the left panel)? There should be a bit more information.
And did you remember to log into your account? Settings / accounts → login

I didn’t update yet though, so no personal experience with Sonoma from my side

1 Like

I tried to click on the left panel, but, unlike before, it doesn’t come out the screen with infos…

But above all, what that error means? (sorry for my ignorance :pray:)

I believe the error means that a codesigning step is added to your xcode build and it’s failing. If the binary actually gets built, you could try signing it yourself with the verbose flag to get more information.

1 Like

sorry but I’m feeling really ignorant… Executable is compiled, but xcode cannot launch it… I still haven’t fully understood what this error that came up after updating the system in Sonoma… here’s a screenshot.

That happens for all my projects (but trying to compile projucer or Audiopluginhost for examples it compiles without errors).

Ok, let’s get this to a debugging level first. Please post all your code-signing settings (maybe censor a few) so we can have a proper look. They are scattered (:man_facepalming:) through multiple areas of Xcode, e.g. project info settings, project code signing settings, project build settings, target build settings and the Xcode account settings.

Do you have your Xcode project under version control? If not, now is the time to fix this! This is the kind of bullshit for which you really need a VSC that not only includes your source but also the Xcode project.

Next, were is your build folder. JUCE normally overwrites that using a user-defined flag (more or less undocumented by Xcode :man_facepalming:) CONFIGURATION_BUILD_DIR, but you may have set that back to the default which would then be somewhere buried in the Xcode global settings.

Now that you have all the informations available, you can start working on the problem.

  1. Make a clean build. And with clean I mean, run the Clean Build phase (I think it’s CMD+SHIFT+K by default). However you still need to delete the build directory (:man_facepalming:) for a proper clean start. Try to compile it again. 80% of the cases I had to deal with busted code-signing, it worked afterwards (:man_facepalming:)
  2. Get your VCS going and try to find a point, where it is still working. Make sure to go through the proper clean every single time to get reliable results.
  3. Check your code signing settings for plausibility. What I mean by that is asking yourself: “Does it make sense, what I’m asking Xcode to do”. It seems a moot point, but it actually helps a lot trying to get through the settings, googling what you don’t understand trying to reverse engineer how it works.
  4. At the moment your are signing to run locally. That is not the default JUCE is shipping with (probably to avoid these kinds of mistakes). You can also try setting the signing identity to nothing. Not sure what it does, but let’s face it, at this point we are desperate.

Last note (Apple rant enabled): I spend a lot of hours trying to get code signing to work the way I want to, and frankly I can’t understand why it is such a mess and is breaking sometimes, even though you know you didn’t change anything, or why it is so easy to be broken in the first place. And I’m signing stuff with my apple developer account for distribution (so in the major league over here…). It is a fucking nightmare! Not only are these parts of Xcode buggy, but they involve other parts of MacOS that are also buggy (like the Profiles in System Settings or the KeyChain Access or the messed up online formulas for getting the application ids and what not :man_facepalming:) so it is for months at a point, where I just don’t touch anything, in order not to fuck anything up.

In case you want to see how far you may go: This is how my Keychain Access looks like

All four of those chains are empty, I don’t know what the hell they are doing there sitting empty, too afraid to even look at them.
The documentations are a total piece of crap, googling gets you nowhere, because most of that changed over the last years, so you don’t know what to believe. Last resort was to write the apple developer tech support (and I mean, writing the tech support :man_facepalming:) to get things resolved, but the online form for that had a bug too, which made me loose ruffly 30 minutes of typing to explain my problem. (Apple rant off)

1 Like

lets start from this … I create a new completely void project in projucer and I screenshots some docs (signing related) in xcode

Ok, change the code signing identity to an empty string please. Select the parent item and all the sub MacOS SDK Release Debug stuff at once and press DEL. Then (when everything is deleted) open the dropdown menu for Code Signing, select other, remove what ever is in there (probably a -) and click out of the window. Now it should just show an empty field.

1 Like

This is how it is supposed to look after applying my steps above.

1 Like

ok… really thank you :heart::pray:… now it works… but why this thing was not necessary for previous os versions…?