electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.58k stars 1.73k forks source link

Mac Sonoma App Won't Open #8048

Closed ProdigyView closed 3 days ago

ProdigyView commented 7 months ago

On Mac M1 with Sonoma 14.3.1 (23D60), I am successfully my application. The mac section in my package.json is this:

"afterSign": "build/notarize.js",
"dmg": {
      "sign": false
},
"mac": {
      "category": "public.app-category.games",
      "icon": "src/images/logo/icon.icns",
      "hardenedRuntime": true,
      "gatekeeperAssess": false,
      "entitlements": "build/entitlements.mac.plist",
      "entitlementsInherit": "build/entitlements.mac.plist",
      "extendInfo": {
        "ElectronTeamID": "xxxxxxx",
        "NSMicrophoneUsageDescription": "Please give us access to your microphone",
        "NSCameraUsageDescription": "Please give us access to your camera",
        "NSScreenRecordingUsageDescription": "Please give us access to record your screen",
        "com.apple.security.device.audio-input": true,
        "com.apple.security.device.camera": true,
        "com.apple.security.screen-recording": true
      },
      "target": {
        "target": "default",
        "arch": [
          "x64",
          "arm64"
        ]
      }
    }

It produces an arm64.dmg and a intel dmg, but when I go run my application, I get this:

    open -a MyApp.app                      
The application /Volumes/MyApp 1.5.7-arm64/MyApp.app cannot be opened for an unexpected reason, error=Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x600002977780 {Error Domain=NSPOSIXErrorDomain Code=153 "Unknown error: 153" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}

Here are my entitlements:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.security.cs.allow-jit</key>
    <true/>
    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
    <true/>
    <key>com.apple.security.cs.allow-dyld-environment-variables</key>
    <true/>
    <key>com.apple.security.device.microphone</key>
    <true/>
    <key>com.apple.security.device.audio-input</key>
    <true/>
    <key>com.apple.security.device.camera</key>
    <true/>
    <key>com.apple.security.screen-recording</key>
    <true/>
    <key>LSApplicationCategoryType</key>
    <string>public.app-category.games</string>
  </dict>
</plist>

And my build/notarize.js:

const { notarize } = require('electron-notarize');

exports.default = async function notarizing(context) {
  const { electronPlatformName, appOutDir } = context;
  if (electronPlatformName !== 'darwin') {
    return;
  }

  const appName = context.packager.appInfo.productFilename;

  return await notarize({
    appBundleId: 'com.invirtu.glitch',
    appPath: `${appOutDir}/${appName}.app`,
    appleId: "xxxxxx",
    appleIdPassword: "xxxxxxxx",
    ascProvider: "xxxxxx"
  });
};

Any idea on what can be causing the app not to open? It's built correctly before in the past.

mmaietta commented 7 months ago

Have you checked out this issue? https://forums.developer.apple.com/forums/thread/666611?page=5

Looks like it might be related to signing credentials or entitlements?

Can you try next electron-builder v24.13.0, there were some changes related to extendInfo for merging with app entitlements

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 3 days ago

This issue was closed because it has been stalled for 30 days with no activity.