Xcode 11, Command CodeSign failed with a nonzero exit code

Viewed 18567

Ever since updating (against my will) to Xcode 11, I'm getting this error when I try to build my project:

CodeSign /Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098/bin/pplight-ofx-098Debug.app (in target 'pplight-ofx-098' from project 'pplight-ofx-098')
cd /Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

Signing Identity:     "-"


 /usr/bin/codesign --force --sign - --entitlements /Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098/build/pplight-ofx-098.build/Debug/pplight-ofx-098.build/pplight-ofx-098Debug.app.xcent --timestamp=none /Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098/bin/pplight-ofx-098Debug.app

/Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098/bin/pplight-ofx-098Debug.app: code object is not signed at all
In subcomponent: /Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098/bin/pplight-ofx-098Debug.app/Contents/Frameworks/GLUT.framework
Command CodeSign failed with a nonzero exit code

I've tried cleaning my project, resetting my login keychain, and restarting my computer, but I still get this error... what to do?

I am building an OSX App using OpenFrameworks, not an iOS App. When I build it in Xcode 10.3 works fine with no errors.

The parts of this question that are unique is that this is for Xcode 11, not 10, and none of the answers for that other question worked for me!

8 Answers

I've resolved the same exact problem by:

  1. Add --deep to the "Other Code Signing Flags" in the "Build Settings".
  2. In the "Signing & Capabilities" of your target click on "+ Capability" in the top left corner and choose "Hardened Runtime".
  3. Then turn on "Disable Library Validation" in the list.

I don't really know if there's any drawbacks by using this capability, however my application compiles and works fine both on macOS and iOS.

You can get this error if you have added a folder to your project as a 'folder reference' (the project will have a blue folder logo in Xcode)

  • Remove the folder (Trash)
  • Add folder and select 'Create Groups' instead of 'Folder Reference' at the dialog Add Folder Dialog

I got the same error after I upgraded to XCode-11 this morning. Builds in the simulator but not on device.

This thread helped fix the issue which I summarized below.

https://stackoverflow.com/a/52628909/9286768

  • Open keychain access.
  • Lock the 'login' keychain. (right clicking on "login" in the upper left panel)
  • Unlock it, enter your PC account password.
  • Clean Project in the product menu.
  • Build it Again.

I fixed this by adding --deep to Other Code Signing Flags in the Build Settings > Signing

I had the same issue for all my Carthage Frameworks, the solution is:

Under Target-> [AppName] -> General -> "Frameworks, Libraries and Embedded Content"

Select "Do Not Embed" for the option next to the problematic framework.

More info are in this thread

NOTE: this might not fully solved the issue, never forget to try clean the project, restart Xcode even restart Mac sometimes.

I solved the problem as follows: After adding 2 ".png" files, Xcode (Version 13.2.1 (13C100)) would not compile anymore. I integrated these 2 files in a .rtf file (generated from Xcode) and I succeeded in compiling again. That's how it goes.

I fixed the problem by making sure the Code Signing Identity in Build Settings was correct - not just general Apple Development and then cleaned the Build Folder in in the Product Menu. When I ran it again it built without error.

I resolved a similar error in Xcode 13 by only changing my Base SDK to the latest SDK (i.e. iOS 15).

Related