electronelectron-builder

Can't sign code with electron-builder because of com.apple.FinderInfo and com.apple.fileprovider.fpfs#P


I'm working on signing an Electron app, but the codesign command fails due to the presence of com.apple.FinderInfo and com.apple.fileprovider.fpfs#P extended attributes on files within my app bundle. I have verified my certificates and they are ok, but electron-builder is unable to sign the app because of these attributes.

Does anyone have similar issue?

Here is full electron-builder error

> electron-builder -m

  • electron-builder  version=24.6.4 os=23.0.0
  • loaded configuration  file=package.json ("build" field)
  • loaded parent configuration  preset=react-cra
  • writing effective config  file=dist/builder-effective-config.yaml
  • packaging       platform=darwin arch=arm64 electron=27.0.4 appOutDir=dist/mac-arm64
  • signing         file=dist/mac-arm64/Ask.app identityName= *** identityHash=*** provisioningProfile=none
  ⨯ Command failed: codesign --sign *** --force --timestamp --options runtime --entitlements entitlements.plist /Users/mateusz/Desktop/Projects/screen-question-app/frontend/dist/mac-arm64/Ask.app/Contents/Frameworks/Ask Helper (GPU).app/Contents/MacOS/Ask Helper (GPU)
/Users/mateusz/Desktop/Projects/screen-question-app/frontend/dist/mac-arm64/Ask.app/Contents/Frameworks/Ask Helper (GPU).app/Contents/MacOS/Ask Helper (GPU): replacing existing signature
/Users/mateusz/Desktop/Projects/screen-question-app/frontend/dist/mac-arm64/Ask.app/Contents/Frameworks/Ask Helper (GPU).app/Contents/MacOS/Ask Helper (GPU): resource fork, Finder information, or similar detritus not allowed
  failedTask=build stackTrace=Error: Command failed: codesign --sign *** --force --timestamp --options runtime --entitlements entitlements.plist /Users/mateusz/Desktop/Projects/screen-question-app/frontend/dist/mac-arm64/Ask.app/Contents/Frameworks/Ask Helper (GPU).app/Contents/MacOS/Ask Helper (GPU)
/Users/mateusz/Desktop/Projects/screen-question-app/frontend/dist/mac-arm64/Ask.app/Contents/Frameworks/Ask Helper (GPU).app/Contents/MacOS/Ask Helper (GPU): replacing existing signature
/Users/mateusz/Desktop/Projects/screen-question-app/frontend/dist/mac-arm64/Ask.app/Contents/Frameworks/Ask Helper (GPU).app/Contents/MacOS/Ask Helper (GPU): resource fork, Finder information, or similar detritus not allowed

I've tried using xattr -cr to remove these attributes recursively, and also tried to remove them manually using xattr -d, but they persist. I can't determine why these attributes are being created in the first place. Here's what happens when I attempt to remove them:

xattr -cr ./dist/mac-arm64/Ask.app
xattr -l ./dist/mac-arm64/Ask.app/Contents/Frameworks/Electron Framework.framework

The output still shows the com.apple.FinderInfo and com.apple.fileprovider.fpfs#P attributes present.


Solution

  • We had the problem at the same time ^^

    The problem occurred when I upgraded MacOs from Monterey to Sonoma.

    This is related to "extended attributes" which are used by icloud to track synchronized files and which have apparently appeared in recent versions of MacOs, this article put me on the trail: https://discussions.apple.com/thread/254036468

    And it's effectively impossible to delete them using the commands provided by Apple: https://developer.apple.com/library/archive/qa/qa1940/_index.html

    Solution: The simplest solution I've found is to move my project directory away from the files synchronized with Icloud. To my User directory in my case. And in this case, no more problems when signing and the command no longer returns an "extended attributes" list for my folder:

    xattr -lr <path_to_app_bundle>