1

I have this anoying build fail with an error: Command CodeSign failed with a nonzero exit code

I am using Xcode 12.5 (12E262).

This happened when I converted a .dae file to .scn and added it to my ARKit project (instead of a default ship.scn).

The error appears only when I trying to run the project on my physical device(iPhone 11 pro) but it runs successfully on a simulated device. I don't use pods or any external frameworks in this project.

I tried this solutions with no success: Stack1 and Stack2. Apple documentation wasn't helpful.

Sorry for bad Eng. I am trying my best to improve both ways - non-native language and a programming language :) Please - do your magic!

Ilya Valito
  • 81
  • 2
  • 7

1 Answers1

1

Actually - I'm finally found a solution! To be more precise - a combination of solutions! Work's for me when I followed exact sequence:

  1. (Optional) Go to Xcode Preferences -> Locations tab and make sure that the Command Line Tools is set (to Xcode 12.5 (12E262) in my case).

  2. Open a terminal and run:

    rm -rf Users/yourUserFolder/Library/Developer/Xcode/DerivedData/*

    then cd to your project folder and run xattr -cr

  3. Open a Keychain Access and delete all items from a "login" keychain.

  4. Go to Xcode Product -> Clean Build Folder and close the Xcode.

  5. Reboot the PC (was very important in my case!)

  6. Build\Run your project.

Since this steps were made - I haven't had this error anymore.

Ilya Valito
  • 81
  • 2
  • 7