1

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?

Community
  • 1
  • 1
RGriffiths
  • 5,722
  • 18
  • 72
  • 120
  • What if you try to build using real device (or "Generic iOS Device") and not simulator? – 0xNSHuman Mar 29 '17 at 22:34
  • Yes, I could try that but there is some CoreData changes made in the app that we would like to test. The data may be lost on the device which we don't want if we can avoid it. – RGriffiths Mar 29 '17 at 22:37
  • You say the certs and provisioning profiles are fine, but don't mention the private key for the cert. Is that also on the other Mac? Also, this is a Mac app, correct? I'm guessing that given the old Mac is running Sierra, you are also now trying to build using an older version of Xcode. I suspect that may also be part of the problem. What versions of Xcode are on the two machines? – wottle Mar 30 '17 at 01:49

2 Answers2

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.

wottle
  • 13,095
  • 4
  • 27
  • 68
  • I'm on Xcode 8.2.1 but when I run that command -lr on the bundle that is causing the issue, I get nothing as result of the command. When I run the -cr one, the error doesn't go away. – C0D3 May 15 '17 at 18:25
  • You are seeing the "resource fork, Finder information, or similar detritus not allowed" error when you build? – wottle May 15 '17 at 19:43
0

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.

C0D3
  • 6,440
  • 8
  • 43
  • 67