Search code examples
xcodeprovisioning-profile

Xcode Development Codesigning Issue


I recently transferred an app from one account to another. I can submit the app to the App Store and run it in the simulator. However, when I try to run it on my device I get this error:

CodeSign /Users/floydresler/Library/Developer/Xcode/DerivedData/App_for_Dark_Tower-egxiflrzexibnghkjwvtznkhigek/Build/Products/Debug-iphoneos/App\ for\ Dark\ Tower.app
cd "/Users/floydresler/Source Code/App for Dark Tower"
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity:     "iPhone Developer: Floyd Resler (6UFPUB2SE5)"
Provisioning Profile: "Dark Tower Dev"
                  (31912d69-5ec4-4740-a696-81ea06d3f3fb)

/usr/bin/codesign --force --sign 4EA262133AD193D1EB339D5E39FC055053663735 --entitlements  
/Users/floydresler/Library/Developer/Xcode/DerivedData/App_for_Dark_Tower-egxiflrzexibnghkjwvtznkhigek/Build/Intermediates/App\ for\ Dark\ Tower.build/Debug-iphoneos/App\ for\ Dark\ Tower.build/App\ for\ Dark\ Tower.app.xcent --timestamp=none
/Users/floydresler/Library/Developer/Xcode/DerivedData/App_for_Dark_Tower-egxiflrzexibnghkjwvtznkhigek/Build/Products/Debug-iphoneos/App\ for\ Dark\ Tower.app

/Users/floydresler/Library/Developer/Xcode/DerivedData/App_for_Dark_Tower-egxiflrzexibnghkjwvtznkhigek/Build/Products/Debug-iphoneos/App for Dark Tower.app: resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1

I have tried cleaning, deleting derived data, recreating the development provisioning profile and nothing works. What am I doing wrong>


Solution

  • A common cause of xcode CodeSign failing with "resource fork, Finder information, or similar detritus not allowed" is additional file attributes being set, often on PNG images.

    *** Before proceeding back all your files up, twice, then again, never run batch commands on your project that you dont understand.

    You can clean your PNGs with:

    find /Users/You/Project -name "*png" -exec xattr -v -c '{}' \;
    

    You can repeat this for all project files with:

    find /Users/You/Project -exec xattr -v -c '{}' \;
    

    You can choose just to run this on the built project rather than your source by running it on the directory listed with the error, eg If the error is:

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

    Run:

    find /Users/me/Library/Developer/Xcode/DerivedData/Project-ervhbywkvwhcpnguqaezmqqsbiqe/Build/Products/Debug/My.app -exec xattr -v -c '{}' \;