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

21.x Mac App Store: Provisioning profile ignored, platform 'mas' !== 'darwin' #4152

Closed
james-criscuolo opened this issue Aug 12, 2019 · 3 comments

Comments

@james-criscuolo
Copy link

  • Version: 21.2.0
  • Target: MAS

I've been trying to get the new version of electron-builder to work for app store submissions, and several of the updates have gotten me closer, but I'm still running into a problem. After turning on debugging, it looks like my provisioning profile is getting pulled, but then ignored. I don't have the opportunity right now to pull logs from the old version, but here's what I'm seeing (Content in <> is replaced, should be unnecessary)

Provisioning profile:
 > Name: <MY APP>
 > Platforms: [ 'mas' ]
 > Type: distribution
 > Path: <path/of/project>/embedded.provisionprofile
 > Message: { CreationDate: '2019-06-03T16:40:08Z',
  Entitlements:
   { 'com.apple.application-identifier': '<APP-IDENTIFIER',
     'keychain-access-groups': [ '<ACCESS_GROUP>.*' ],
     'com.apple.developer.team-identifier': '<TEAM_ID>' },
  TeamName: '<TEAM_NAME>',
  AppIDName: '<APP_NAME',
  Platform: [ 'OSX' ],
  IsXcodeManaged: false,
  TimeToLive: 338,
  Version: 1,
  ApplicationIdentifierPrefix: [ '<APP_PREFIX' ],
  ExpirationDate: '2020-05-06T16:46:41Z',
  Name: '<APP_NAME,
  TeamIdentifier: [ '<TEAM_ID>' ],
  UUID: '<UUID>',
  DeveloperCertificates:
   [ '<MY_DEV_CERT>' ] }
Provisioning profile above ignored, not for darwin distribution.

The line in question in util-provisioning-profiles.js:

if (provisioningProfile.platforms.indexOf(opts.platform) >= 0 && provisioningProfile.type === \|NeMKdoRwTeSr1EJtwYaLNxUsLDPt3cKdmqgKPZnmAZg5bSL9P3hwr4mkoSl7fR/TUwmrU1vVbDRrnWsGfiaF0rf/00uwIDAQABo4IB8TC\
opts.type)

The final log line has opts.platform as "darwin" and opts.type as "distribution".

I'm not entirely sure where I could even add "darwin" to get this to work, I'm not sure where that platforms array is pulled from (it is not directly in the provisioning profile).

@james-criscuolo james-criscuolo changed the title 21.x Mac App Store: Provisioning profile ignored, platform 'OSX' !== 'darwin' 21.x Mac App Store: Provisioning profile ignored, platform 'mas' !== 'darwin' Aug 12, 2019
@james-criscuolo
Copy link
Author

On the latest 20.x.x version, It looks like the same check actually occurs and the provisioning profile is ignored, until another check comes through where the platform is mas, at which point the provisioning profile is used. In 21.x, the function in question throws and error that prevents it from continuing to the correct provisioning profile check:

• signing         file=<File.app> identityName=Developer ID Application: <Application> identityHash=<Hash> provisioningProfile=none
  ⨯ ENOENT: no such file or directory, unlink '/var/folders/hc/q0_cl3q11d12jqv6j7wyt1dr0000gn/T/353303512c85e0491e95aa69aff7c3f62a5f5c46.plist'  stackTrace=
     Error: ENOENT: no such file or directory, unlink '/var/folders/hc/q0_cl3q11d12jqv6j7wyt1dr0000gn/T/353303512c85e0491e95aa69aff7c3f62a5f5c46.plist'
       at runCallback (timers.js:705:18)
       at tryOnImmediate (timers.js:676:5)
       at processImmediate (timers.js:658:5)
       From previous event:
          at module.exports.getProvisioningProfileAsync (/<project_path>/node_modules/app-builder-lib/electron-osx-sign/util-provisioning-profiles.js:66:6)
          at /<project_path>/node_modules/app-builder-lib/electron-osx-sign/util-provisioning-profiles.js:110:14
          From previous event:
             at module.exports.findProvisioningProfilesAsync (/<project_path>/node_modules/app-builder-lib/electron-osx-sign/util-provisioning-profiles.js:109:6)
             at module.exports.preEmbedProvisioningProfile (/<project_path>/node_modules/app-builder-lib/electron-osx-sign/util-provisioning-profiles.js:162:12)
             at /<project_path>/node_modules/app-builder-lib/electron-osx-sign/sign.js:327:15

Once I saw the above, I thought the provisioning profile being ignored was the cause, but maybe that isn't the case. I am running electron-builder build --mac --x64 --ia32.

@quanglam2807
Copy link
Contributor

This is probably related to #4074

@james-criscuolo
Copy link
Author

I'm going to close this, I still get the error with my old configuration, but I ended up following this article (linked in electron-builder's docs): https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/

With that, and not running two targets in one call to build (saw in another issue), I was able to notarize my app successfully and run it on Catalina.

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

2 participants