Xcode 8 can't archive “Command /usr/bin/codesign failed with exit code 1”

✅ Hello, I've got a problem on Xcode 8 on macOS Sierra. when I try to build my app, I get the following issue.


CodeSign /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp.app

cd /Users/me/Desktop/MyAppFolder1/MyAppFolder2/MyAppxcode

export CODESIGN_ALLOCATE=/Users/me/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

export PATH="/Users/me/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Users/me/Downloads/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/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp.app


/Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp.app: resource fork, Finder information, or similar detritus not allowed

Command /usr/bin/codesign failed with exit code 1


✅ then I did https://forums.developer.apple.com/thread/48905 in the terminal and it worked. but once I clean, the issue comes back.


cd /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp


ls -al@ *


xattr -c *


✅ and above doesn't work for archive with the following issue. does anyone know the solution for it? I really have no idea...


CodeSign /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app

cd /Users/me/Desktop/MyAppFolder1/MyAppFolder2/MyAppxcode

export CODESIGN_ALLOCATE=/Users/me/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

export PATH="/Users/me/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/me/Downloads/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity: "iPhone Developer: My Name (**********)"

Provisioning Profile: "iOS Team Provisioning Profile: com.**********.*********"

(********-****-****-****-************)


/usr/bin/codesign --force --sign **************************************** --entitlements /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/MyApp.build/Release-iphoneos/MyApp.build/MyApp.app.xcent --timestamp=none /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app


/Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app: resource fork, Finder information, or similar detritus not allowed

Command /usr/bin/codesign failed with exit code 1

Accepted Reply

>or similar detritus not allowed



Try:


execute "xattr -rc ." both in DerivedData directory and Project directory


See: https://forums.developer.apple.com/thread/48726

Replies

>or similar detritus not allowed



Try:


execute "xattr -rc ." both in DerivedData directory and Project directory


See: https://forums.developer.apple.com/thread/48726

After I executed "xattr -rc ." in DerivedData, I got this error😕


Task failed with exit 0 signal 5 {

/usr/bin/codesign '--force' '--sign' '64AD1BBB92372E15F0D3841CCDB0E547351F4BC7' '--verbose' '/Users/Myname/Library/Developer/Xcode/DerivedData/Myapp-bensyburovqkqkcvacgdedoulizo/Build/Products/Debug-iphoneos/Myapp.app/Frameworks/libswiftCore.dylib'

}


I reinstalled Xcode, but it doesn't work.

Anyone know how to fix it?

I got this issure on Xcode 8.1

After I executed "xattr -rc" there was nothing happened

Hi.

I'm running into this problem for the first time today with my project after updating an advertising SDK and have been unable to solve it.


Error:

/Users/Mikzor/Library/Developer/Xcode/DerivedData/Unity-iPhone-cudlmprhgwshgfhbqnmbpcuekeqn/Build/Products/Release-iphoneos/sling.app: resource fork, Finder information, or similar detritus not allowed

Command /usr/bin/codesign failed with exit code 1


I tried doing "xattr -c *" as well as "xattr -rc ." in both the Project folder root and the Derived Data folder root and then perform a clean / rebuild on the project but I always get the same error.


I am using macOS Sierra Version 10.12 and XCode 8.1 (8B62)


Any help appreciated.

Hi ,


Im Also having the same problem . Tried both as above but still have the issue.


Os :10.12.1

Xcode :8.1


after 8.1 Update only im having this issue


Error:

Signing Identity: "-"

/usr/bin/codesign --force --sign - --timestamp=none /Users/keerthi/Library/Developer/Xcode/DerivedData/Voxer-garanexqxxqsaxfshffbufgifwcd/Build/Products/Debug-iphonesimulator/DBChooser.bundle

/Users/keerthi/Library/Developer/Xcode/DerivedData/Voxer-garanexqxxqsaxfshffbufgifwcd/Build/Products/Debug-iphonesimulator/DBChooser.bundle: bundle format unrecognized, invalid, or unsuitable

Command /usr/bin/codesign failed with exit code 1



If Anyone found solution please share .

execute "xattr -rc ." both in DerivedData directory and Project directory


This Helped me to Archive.

Thanks

I bought a new Macbook pro 2015 with Sierra installed .I have been usuing xcode 8.2.1 with my macbook air with El Capitan and no problems. Now all I get is a "codesign fail with exit code" with my macbook pro. Maybe I missed something along the line conserning Sierra. However in my case it does not like images that are tiff. I remove all tiff images and it works. This is for both osx and ios.