'Command CodeSign failed with a nonzero exit code in Xcode Version 13.1

Every time I run my project I get a build time error saying "CodeSign failed with a nonzero exit code"

I've tried cleaning my build folder, force quitting Xcode, searching the web.

Here is the full error message

"/Users/christian/Library/Developer/Xcode/DerivedData/ARDicee-exogyimjlcfynyfnnhzgsemlkeju/Build/Products/Debug-iphonesimulator/ARDicee.app: resource fork, Finder information, or similar detritus not allowed Command CodeSign failed with a nonzero exit code"

Here is a screenshot: Error message screenshot

Here is some code:

import UIKit
import SceneKit
import ARKit

class ViewController: UIViewController, ARSCNViewDelegate {

@IBOutlet var sceneView: ARSCNView!
override func viewDidLoad() {
    super.viewDidLoad()
    // Set the view's delegate
    sceneView.delegate = self
    let diceScene = SCNScene(named: "art.scnassets/diceColladaCopy.scn")!
    if let diceNode = diceScene.rootNode.childNode(withName: "Dice", recursively: true) {
        diceNode.position = SCNVector3(x: 0, y: 0, z: -0.1)
        sceneView.scene.rootNode.addChildNode(diceNode)
    }
}
override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    // Create a session configuration
    let configuration = ARWorldTrackingConfiguration()
    // Run the view's session
    sceneView.session.run(configuration)
}
override func viewWillDisappear(_ animated: Bool) {
    super.viewWillDisappear(animated)
    // Pause the view's session
    sceneView.session.pause()
}

}



Solution 1:[1]

I solved with these steps:

  1. Preferences

  2. Accounts

  3. Login

  4. enter image description here

  5. Add certificate

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jeremy Caney