om patel
om patel

Reputation: 1

I am getting "Command /usr/bin/codesign failed" in XCode when trying to build the app

CodeSign /Users/ompatel/Library/Developer/Xcode/DerivedData/MakeThemFall-ckljohmknnkuehgbzbfbwmcmrfpa/Build/Products/Debug-iphonesimulator/MakeThemFall.app
    cd "/Users/ompatel/Downloads/2 App First/MakeThemFall/MakeThemFall.spritebuilder"
    export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity:     "-"

    /usr/bin/codesign --force --sign - --timestamp=none /Users/ompatel/Library/Developer/Xcode/DerivedData/MakeThemFall-ckljohmknnkuehgbzbfbwmcmrfpa/Build/Products/Debug-iphonesimulator/MakeThemFall.app

/Users/ompatel/Library/Developer/Xcode/DerivedData/MakeThemFall-ckljohmknnkuehgbzbfbwmcmrfpa/Build/Products/Debug-iphonesimulator/MakeThemFall.app: resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1

Upvotes: 4

Views: 432

Answers (2)

Zarif Ahmed
Zarif Ahmed

Reputation: 361

Try to clean the build folder and run the project again.

Command + Shift + Alt + K

Upvotes: 1

Pat_Morita
Pat_Morita

Reputation: 3545

It seems one or more of your files contain any additional extended attributes. This error pops up starting from OSX Sierra through security hardening.

See apples tech note and solution here: https://developer.apple.com/library/content/qa/qa1940/_index.html

This is a security hardening change that was introduced with iOS 10, macOS Sierra, watchOS 3, and tvOS 10.

Code signing no longer allows any file in an app bundle to have an extended attribute containing a resource fork or Finder info.

To see which files are causing this error, run this command in Terminal:

$ xattr -lr path_to_app_bundle

replacing path_to_app_bundle with the path to your actual app bundle

You can also remove all extended attributes from your app bundle with the xattr command:

$ xattr -cr path_to_app_bundle

Note that browsing files within a bundle with Finder's Show Package Contents command can cause Finder info to be added to those files. Otherwise, audit your build process to see where the extended attributes are being added

After that command do a product > clean and try again.

Note: Saving your project in a Dropbox will always add extended attributes but you may deactivate this behaviour in Dropbox settings

Upvotes: 1

Related Questions