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

macos Catalina 10.15.3 Testing MAS app locally crash on launch #4689

Closed
irisariana05 opened this issue Feb 21, 2020 · 2 comments
Closed

macos Catalina 10.15.3 Testing MAS app locally crash on launch #4689

irisariana05 opened this issue Feb 21, 2020 · 2 comments
Labels

Comments

@irisariana05
Copy link

  • Electron: 5.0.13
  • Electron-builder: 21.2.0 (also tried with 20.43.0)
  • Electron-updater (no using)
  • node: 12.0.0
  • macOs: 10.15.3
  • Target: mas (also tried mas-dev)

Hello! I know there is a similar issue, 1196, but I saw it is closed, please let me know If I need to post there.

We tried to publish our Electron app in the App Store, but we are getting this Apple rejection:

Screen Shot 2020-02-20 at 17 33 56

So, now we try to build, sign, notarize and test the app locally before submit to the App Store for review. We are struggling with this for a week, I hope to get your help.

Reading issue 1996 and this post, this for notarization, we configured our package.json as see below:

"build": {  
    "afterSign": "scripts/notarize.js", 
    "appId": "myAppId", 
    "productName": "myApp",
    "buildVersion": 54,
    "mac": {
      "icon": "assets/icons/mac/icon.icns",
      "target": [
        "mas"
      ],
      "hardenedRuntime": false,
      "gatekeeperAssess": false,
      "type": "development",
      "provisioningProfile": "dev.provisionprofile",
      "category": "public.app-category.graphics-design",
      "entitlements": "build/entitlements.mas.plist",
      "entitlementsInherit": "build/child.plist",
      "asarUnpack": [ "**/*.node" ]
    },
    "mas": {
      "type": "development",
      "category": "public.app-category.graphics-design",
      "entitlements": "build/entitlements.mas.plist",
      "entitlementsInherit": "build/child.plist",
      "provisioningProfile": "dev.provisionprofile"
    }
  },

We also tried without the entitlements and provisioningProfile attributes in the "mas" key. So, we sign the app with the Mac Developer cert and a development provisionprofile (from our apple developer account). In the dev.provisionprofile also we added the device on which we want to test the app.

We also configured CSC_LINK and CSC_KEY_PASSWORD variables. The .p12 file contains the following certs:

  • Mac Developer: XXXX (XXXX)
  • 3rd Party Mac Developer Installer: myCompany (XXXXX)
  • 3rd Party Mac Developer Application: myCompany (XXXXX)
  • Developer ID Application: myCompany (XXXXX)

All of them are available in my machine, I checked with security find-identity -v. We won't publish the app outside the App Store.

entitlements.mas.plist


  <?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.app-sandbox</key>
    <true/>
    <key>com.apple.application-identifier</key> 
    <string>XXXX.appId</string>
    <key>com.apple.security.application-groups</key>
    <string>XXXX.appId</string>
    <key>com.apple.security.files.downloads.read-write</key>
    <true/>
    <key>com.apple.security.files.user-selected.read-write</key>
    <true/>
    <key>com.apple.security.network.client</key>
    <true/>
    <key>com.apple.developer.team-identifier</key>
    <string>XXXX</string>
    <key>com.apple.security.cs.disable-library-validation</key>
    <true/>
    <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/>
  </dict>
  </plist>

We are not sure if we have to sign and notarize the app to test locally or only it's necessary to sign the app. So we tried both.

When we run electron-builder build -m without the notarization script (no afterSign attribute) we got the following in the terminal:
Screen Shot 2020-02-20 at 18 12 18

I don't know why my app is being signed twice. Is this an expected behavior?
There are no errors, but when try to open the dist/mas/myApp.app the app failed on launch.

If we sign with the notarization script, we got the following and the notarization process fails:

> electron-builder build -m
  • electron-builder version=20.43.0
  • loaded configuration file=package.json ("build" field)
  • writing effective config file=dist/builder-effective-config.yaml
  • rebuilding native production dependencies platform=darwin arch=x64
  • packaging       platform=mas arch=x64 electron=5.0.13 appOutDir=dist/mas
  • signing         file=dist/mas/myApp.app identityName=Mac Developer: XXXX (XXXX) identityHash=5E49E7D6D89804C109228C3FDBD1364BB1D86E4F provisioningProfile=dev.provisionprofile
afterSign hook triggered {
  appOutDir: '/Users/irisgaleano/Electron-projects/electron-uptaded/dist/mas',
  outDir: '/Users/irisgaleano/Electron-projects/electron-uptaded/dist',
  arch: 1,
  targets: [ NoOpTarget { name: 'mas', isAsyncSupported: true, options: null } ],
  packager: MacPackager {
    info: Packager {
      cancellationToken: [CancellationToken],
      _metadata: [Object],
      _nodeModulesHandledExternally: false,
      _isPrepackedAppAsar: false,
      _devMetadata: [Object],
      _configuration: [Object],
      isTwoPackageJsonProjectLayoutUsed: false,
      eventEmitter: [EventEmitter],
      _appInfo: [AppInfo],
      tempDirManager: [TmpDir],
      _repositoryInfo: [Lazy],
      afterPackHandlers: [Array],
      debugLogger: [DebugLogger],
      _productionDeps: [Lazy],
      stageDirPathCustomizer: [Function],
      _buildResourcesDir: '/Users/irisgaleano/Electron-projects/electron-uptaded/build',
      _framework: [ElectronFramework],
      projectDir: '/Users/irisgaleano/Electron-projects/electron-uptaded',
      _appDir: '/Users/irisgaleano/Electron-projects/electron-uptaded',
      options: [Object]
    },
    platform: Platform {
      name: 'mac',
      buildConfigurationKey: 'mac',
      nodeName: 'darwin'
    },
    _resourceList: Lazy { _value: [Promise], creator: null },
    platformSpecificBuildOptions: {
      icon: 'assets/icons/mac/icon.icns',
      target: [Array],
      hardenedRuntime: false,
      gatekeeperAssess: false,
      type: 'development',
      provisioningProfile: 'dev.provisionprofile',
      category: 'public.app-category.graphics-design',
      entitlements: 'build/entitlements.mas.plist',
      entitlementsInherit: 'build/child.plist',
      asarUnpack: [Array]
    },
    appInfo: AppInfo {
      info: [Packager],
      platformSpecificOptions: [Object],
      description: 'Electron desktop app',
      version: '1.1.23',
      buildNumber: undefined,
      buildVersion: '54',
      productName: 'myApp',
      productFilename: 'myApp'
    },
    codeSigningInfo: Lazy { _value: [Promise], creator: null },
    _iconPath: Lazy { _value: [Promise], creator: null }
  },
  electronPlatformName: 'mas'
}
Notarizing com.oktana.Chatter-Desktop found at /Users/irisgaleano/Electron-projects/electron-uptaded/dist/mas/myApp.app
Error: Apple failed to notarize your application, check the logs for more info
Status Code: 2
Message: Package Invalid
Logs: https://osxapps-ssl.itunes.apple.com/itunes-assets/Enigma113/v4/1a/22/25/1a22255a-189b-bfb0-ba5e-1626e4704d3b/developer_log.json?accessKey=1582428560_7303539274127545372_bCbf%2FNgCBeoWp4669wYiZgmXVFaXWfeePqmgfmAaA9t8z90Jia1zURDIoEHDfErXTPcdEW1vrMAWweoxdBxc9ngqabvkYzJtTL5rDU1SGgORjTrHpLXEUZA5vUsGYcyO2Kd0mh0AC0nSg8Io%2FbaAh19eOhoR62Du8bosepWkvew%3D
    at /Users/irisgaleano/Electron-projects/electron-uptaded/node_modules/electron-notarize/src/index.ts:132:11
    at Generator.next (<anonymous>)
    at fulfilled (/Users/irisgaleano/Electron-projects/electron-uptaded/node_modules/electron-notarize/lib/index.js:4:58)
    at processTicksAndRejections (internal/process/task_queues.js:88:5)
Done notarizing com.oktana.Chatter-Desktop
  • signing         file=dist/mas/myApp.app identityName=Mac Developer: XXXXX (XXXX) identityHash=5E49E7D6D89804C109228C3FDBD1364BB1D86E4F provisioningProfile=dev.provisionprofile 

The log link at the end of the notarization process shows:
Screen Shot 2020-02-20 at 18 44 46

  • If we want to test the signed app before submit to the App Store for review, is it necessary to notarize too?
  • What configuration we are missing or we have to check it?

I hope some of you can guide me to the correct direction because we already tried different things but still no progress.

Thank you in advance!

@stale
Copy link

stale bot commented Apr 22, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Apr 22, 2020
@stale stale bot closed this as completed Apr 29, 2020
@philippnoah
Copy link

Any news on this?

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

No branches or pull requests

2 participants