Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add entitlements.plist #3521

Open
3 tasks done
Jaarson opened this issue Mar 1, 2024 · 3 comments
Open
3 tasks done

Can't add entitlements.plist #3521

Jaarson opened this issue Mar 1, 2024 · 3 comments

Comments

@Jaarson
Copy link

Jaarson commented Mar 1, 2024

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.2.0

Electron version

28.2.2

Operating system

macOS 14.0

Last known working Electron Forge version

No response

Expected behavior

Code from Docs should work, by using provided entitlements:

module.exports = {
  // ...
  packagerConfig: {
    // ...
    osxSign: {
      optionsForFile: (filePath) => {
        // Here, we keep it simple and return a single entitlements.plist file.
        // You can use this callback to map different sets of entitlements
        // to specific files in your packaged app.
        return {
          entitlements: './entitlements.plist'
        };
      }
    }
  }
  // ...
};

Actual behavior

When running npm run make it fails with following error

An unhandled rejection has occurred inside Forge:
Error: Failed to codesign your application with code: 1

MyApp.app: code has no resources but signature indicates they must be present

After commenting out optionsForFile part, there are no errors

Steps to reproduce

Create entitlements.plist file in root directory of your project, with the content from default entitlements:
https://github.com/electron/osx-sign/blob/main/entitlements/default.darwin.plist

Additional information

No response

@NxRoot
Copy link

NxRoot commented Mar 26, 2024

Same problem here when trying to setup permissions for microphone, it just crashes after packaging.

Ive also tested this using an old project with older versions and it works fine.
So it seems to be a problem with the new versions.

Waiting for a fix...

@MarshallOfSound
Copy link
Member

The default entitlements file is only user for some things in the default configuration. The reference implementation of "default options for file" is here https://github.com/electron/osx-sign/blob/main/src/sign.ts#L96-L112 and you can see that various entitlements files are used for different paths. Removing that logic will cause issues similar to what this original post is about

@NxRoot
Copy link

NxRoot commented Mar 27, 2024

Perhaps anyone can help me out with this, im trying to use the microphone input.
But it seems that the .app executable itself doesnt have the same behaviour as the Unix executable.

.app Exec (MICROPHONE DOES NOT WORK AND DOES NOT REQUEST PERMISSION)

Unix Exec (MICROPHONE WORKS AND REQUESTS PERMISSION)

There's no way to make an app this way.

Help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants