Xcode CodeSign fails on resource fork or Finder information
resource fork, Finder information, or similar detritus not allowedShort answer
Code signing refuses an app bundle when any file in it carries an extended attribute such as a resource fork or Finder info. List the attributes with xattr -lr on the bundle, clear them with xattr -cr, and build again. If they come back, a step in your build or a Finder action keeps adding them, so find that step.
Fix it fast
1Find out which cause you have
List the extended attributes on the built app. The files it prints are the ones that block signing.
xattr -lr /path/to/MyApp.app2Match what you see, then jump to its fix
What does the error look like?
resource fork, Finder information, or similar detritus not allowedCommand CodeSign failed with a nonzero exit code
Cause 1 of 2
Files in the bundle carry resource fork or Finder info attributes
1Check
Apple's QA1940 explains that code signing does not allow any file in an app bundle to have an extended attribute holding a resource fork or Finder information. List them to see which files are affected.
xattr -lr /path/to/MyApp.app2Fix
Remove all extended attributes from the bundle, then sign again. If the files come from your source folders, clear them there too so every build starts clean.
xattr -cr /path/to/MyApp.app
xattr -cr /path/to/project/source-folder-with-resources3Verify
The list command prints nothing, and the build signs without the error.
xattr -lr /path/to/MyApp.appConfirmed by developer.apple.com
Cause 2 of 2
Something keeps adding the attributes back
1Check
QA1940 says that browsing inside a bundle with Finder's Show Package Contents can add Finder information to the files in it. It also tells you to audit your build process to find the step that adds the attributes instead of only clearing them by hand.
xattr -lr /path/to/MyApp.app | head2Fix
Stop opening the built bundle in Finder. Find the Run Script, copy step or tool that touches the files and make it avoid adding attributes, or clear the attributes in the source files it copies.
# compare attributes on a source file and its copy in the bundle
xattr -l path/to/source/file
xattr -l /path/to/MyApp.app/file3Verify
Build twice in a row without touching the bundle. Signing succeeds both times.
xcodebuild -project MyApp.xcodeproj -scheme MyApp -configuration Release buildConfirmed by developer.apple.com
How do I stop it coming back?
- Do not open a built .app with Show Package Contents before it is signed.
- Clear extended attributes on files you copy in from downloads or other Macs before adding them to the project.
- Keep build steps that copy resources free of tools that add Finder metadata.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Mobile apps
Cannot change the App Privacy answers in App Store Connect
Publish Your App Privacy Responses?
Only the Account Holder, Admin and App Manager roles can answer the App Privacy questions.
2 causes, each with a fixMobile apps
App record creation fails because you lack permission
You cannot add a new app in App Store Connect as a Developer or limited user
Only the Account Holder, an Admin or an App Manager can create an app record, and Apple blocks it until the Account Holder has signed the latest agreement.
3 causes, each with a fixMobile apps
You cannot find the button to pull your app back from review
No 'remove this version from review' message appears on the version page
There is no button called Reject Binary.
3 causes, each with a fixMobile apps
Your Apple Account cannot sign in to App Store Connect
Sign-in to App Store Connect is refused for an account that should have access
App Store Connect does not open to every Apple Account.
3 causes, each with a fixMobile apps
Apple rejected the app under Guideline 4.3, Design: Spam
Guideline 4.3(b) - Design - Spam
Guideline 4.3 is Apple's duplicate rule.
5 causes, each with a fixMobile apps
App Store Connect rejects a screenshot because it has transparency
Images can't include alpha channels or transparencies.
App Store Connect does not accept screenshots that carry an alpha channel or transparent pixels.
2 causes, each with a fix