问题
I have an app that builds on my Mac (running El Capitan) but when I copy the app project folder onto another Mac (running Sierra if that may be the problem) and run the project I get the code signing error:
CodeSign /Users/.../Library/Developer/Xcode/DerivedData/appname-fgarszmikfuloefrynwpohxkvgav/Build/Products/Debug-iphonesimulator/appname.app
cd "/Users/... app path"
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/.../Library/Developer/Xcode/DerivedData/appname-fgarszmikfuloefrynwpohxkvgav/Build/Products/Debug-iphonesimulator/appname.app
/Users/.../Library/Developer/Xcode/DerivedData/appname-fgarszmikfuloefrynwpohxkvgav/Build/Products/Debug-iphonesimulator/appname.app: resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1
New certs and provisioning profiles etc but all that should be fine.
Followed every suggestion I can find on here (specifically Code Sign Error in macOS Sierra Xcode 8 : resource fork, Finder information, or similar detritus not allowed), cleaned, alt-cleaned. Auto manage signing doesn't fix it.
I have paid developer account.
Can anyone suggest what might be causing the problem?
回答1:
It seems like this error is caused by extended attributes on files in your project.
You can find out which files are causing this failure by running the following command: xattr -lr <path_to_app_bundle>
You can remove the extended attributes using this command: xattr -cr <path_to_app_bundle>
More info here.
回答2:
We noticed that a .bundle group which was created in XCode version 8.0.0 was later being used in 8.2.1 and once we removed the bundle and re-added it using XCode 8.2.1, the error was gone. Also it may have something to do with the folder name "Resources" in this bundle. I believe this is an XCode bug but don't quote me on it.
来源:https://stackoverflow.com/questions/43105334/code-signing-error-in-xcode-8-2-1