Code signing a framework fails with "Permission denied" error

Viewed 767

I've recently added the Plantronics macOS SDK (Spokes3GSDK.framework) to my Electron desktop app.

When I attempt to sign the app, it fails with "Permission denied" error.

  ⨯ Error: Command failed: codesign --sign IDENTITY_HASH --force --timestamp --options runtime --entitlements ./setup/build/entitlements.mac.plist /private/var/lib/jenkins/workspace/MY_BRANCH/compile/mac/MY_APPLICATION.app/Contents/Frameworks/Spokes3GSDK.framework/Versions/A/Spokes3GSDK
/private/var/lib/jenkins/workspace/MY_BRANCH/compile/mac/MY_APPLICATION.app/Contents/Frameworks/Spokes3GSDK.framework/Versions/A/Spokes3GSDK: replacing existing signature
/private/var/lib/jenkins/workspace/MY_BRANCH/compile/mac/MY_APPLICATION.app/Contents/Frameworks/Spokes3GSDK.framework/Versions/A/Spokes3GSDK: Permission denied

I'm using electron-builder to build and sign my app so I've also created an issue here. Though, the issue seems to be really caused by the codesign tool.

1 Answers

The problem for me was that jenkins was copying the SDK files without changing the owner "root". So, a sudo was needed to make this command work.

I copied these files manually and put them in my repository (the owner of the file changed) and sudo was no longer needed.

Related