Xcode 11, Command CodeSign failed with a nonzero exit code

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

"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?


Are you by any chance using flutter and the flutter run command to perform the build? If so, does clicking the build/run button in Xcode work?


If this is the situation you are running into, there is an open ticket over at Github raising this issue. The problem appears to be in ios-deploy not working on the latest version of Xcode that we were forced to upgrade to.


I just bought a new Mac and iPhone and ran into this issue. No fix yet other than to remotely log into the machine and push the button in Xcode.


Please let know if you are in fact using Flutter and if clicking the run button in Xocde fixed your issue also, because then it confirms to me that there are at least 3 people with the exact same issue so far.

Same issue here and apple has offered no help. EVERY time they upgrade something it breaks something in my development process, very frustrating.

i'm having the same issue. i had the issue before but only when adding or modifying png files to my project folder. the fix was to xattr -cr the build folder and it would compile again.


but now this happens every single time and the xattr doesn't work on my current project and i can't build anything.

same here...


all apples older example code are USELESS with xcode 11 due to failed code signing...


VISTA has come to macOS

having the same issue. it ain't me.

Restarting the OS solved this for me

not for me.

the app actually compiles and runs in the OS.

This is a BUG in XCode.

What worked for me is to delele image files which were added in 'SceneKitAssetCatalog.scnassets' folder. I think only 3D objects formats like usdz, scn, obj etc are allowed in 'SceneKitAssetCatalog.scnassets' folder.
And moved the images which were required to be applied as texture to 3D scn object in a separate folder.


I got the same warning"command codesign failed with a nonzero exit code"

my project can not run on Simulator but totally ok on my real machine.

I tried " product -> Clean Build Folder". And it looks working for me.(OOPS, Just realized you said did it too and not working for you. rip.)


For me this was after adding a .png file to an existing .scn assets folder, plus also a .wav file.

I searched and searched for multiple reasons and found that Xcode, owing to increased security, doesn't like extensions on files, I deleted the files and the project rebuilt fine, I then used terminal to 'cd' into the files in question directly and removed their extensions using the 'xattr' command in Terminal

To Remove All Extended Attributes On a Single File

Use xattr with the -c flag to "clear" the attributes:
xattr -c yourfile.txt

To Remove All Extended Attributes On Many Files

To recursively remove extended attributes on all files in a directory, combine the -c "clear" flag with the -r recursive flag:
xattr -rc /path/to/directory

this link is useful also for some other fixes and more detail...
https://stackoverflow.com/questions/4833052/how-do-i-remove-the-extended-attributes-on-a-file-in-mac-os-x
Happening to me on 12.2. I was saving project on cloud. Moved to local disk and it compiles now
kedar619 who I wish I could thank actually brought up a very important solution which is with those who use Scenekit. If you have non-3D files inside the now called art.scnassets folder, there is a good chance your project won't compile. I went looking all over the place for solutions to the Command CodeSign error problem, and then when I checked my assets folder I found iCloud duplications in there, so when I deleted them the project finally built successfully.
Thanks all, I run: xattr -cr /Users/j...... Products/Debug-maccatalyst/ on Terminal and worked !!!.
Support to developers from Apple very improvable ....

描述文件对应的证书应该是299MFJ63GP,实际上Xcode配置错误,手动将project文件中8JQ353ME6X的id删除,重新保存后运行,一切正常。

For those who tried all solutions without any success, try to download and install the latest certificate from this link: https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer

This solved my issue!

15
Xcode 11, Command CodeSign failed with a nonzero exit code
 
 
Q