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

I solved it by deleting the wrong image file in the 'SceneKitAssetCatalog.scnassets' folder.

I had 2 "Apple Worldwide Developer Relations Certification Authority" certificates. After deleting the older (expired) one in Keychain Access, the error went away in Xcode 13.1.

Same problem. I used to love apple, now I'm moving to other languages away from swift and cocoa. It seems they own me with all this stuff, code signing, tons of manuals, technology updates every five minutes.

Now I can not run my own code, cannot update my app.

Dawn.

what worked for me was to reinstall the profile... then Xcode updated the list of profiles properly. go figure...

Check the Certificate which named Apple Root Certificate Authority, make sure you select the option Use System Defaults under the Trust menu.

Worked for me too. Thanks a lot!

In case someone is still running into this, after hours of attempts this is what finally worked for me: Open Terminal, navigate to project folder and run "xattr -cr ."

Then in Xcode clean project (Shift + Command + K) and rebuild. Good luck!

Has anyone solved the CodeSign proglem. I tried every "solution" presented in this forum, but since then, IOS 17 just came out, so I'm updating now, I'll try again, but if anyone has anything I should know, please reply here.

John

One thing I'm curious about, I'm updating my iPhone iOS now, but it's 16.7.2, But when I went to XCode, its trying to install 17.0.x on my iPhone. Is this because y iPhone no longer supports 17.0.x? It's an iPhone 13, it was release a little more then a year ago, does this mean it's already obsolete.

John

Now I get completely different error message: No such module 'ExpoModulesCore' I'm going to have to try and re-build the expo part and try it again.

This was completely different then the code signing parf.

Just from updating XCode and my IOS.

John

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