Publishing to Mac App Store (MAS) - Pain & Tears
See original GitHub issueVersions:
electron-builder - 20.38.5
electron - 4.0.5
macOS Mojave -10.14.3
target - mas
mas-dev
After publishing signed app to MAS it was rejected by Apple with the following errors:
Your app crashed on Mac running macOS 10.14.3 when we launched the app. No crash log was generated by this crash.
Next Steps Please revise your app and test it to ensure that it runs as expected.
We discovered one or more bugs in your app when reviewed on Mac running macOS 10.14.3.
The app does not display any app window at launch.
So I decided to test the app locally first. To test it locally I have re-sign the app with a development certificate and a development provisioning profile.
The issue is that the mas-dev
app signs and builds successfully but doesn’t start properly.
-
App immediately auto-closes with once opened. _Fixed by removing
app.requestSingleInstanceLock()
for MAS. Related electron issue https://github.com/electron/electron/issues/15958_ -
After launching the icon sits in the toolbar and app window not opens. Fixed by commenting out
// show: false // fixes flash of white // MAS not working!
formainWindow
-
Blank window opens and app hangs _Stucked on this one. Related osx-sign issue https://github.com/electron-userland/electron-osx-sign/issues/151_
There is no error-message or any info in system logs
In the same time regular app with dir
target signs and runs flawlessly.
package.json
"mac": {
"target": [ "mas-dev" ],
"category": "public.app-category.productivity"
},
"mas": {
"category": "public.app-category.productivity",
"entitlements": "build/entitlements.mas.plist"
},
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.security.application-groups</key>
<string>XXXXXXXXXXXXX</string>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist>
Development provisioning profile
/opt/bin/organize-my-files develop ● security cms -D -i embedded.provisionprofile
<?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>AppIDName</key>
<string>allapps</string>
<key>ApplicationIdentifierPrefix</key>
<array>
<string>XXXXXXXXXX</string>
</array>
<key>CreationDate</key>
<date>2019-02-19T22:11:57Z</date>
<key>Platform</key>
<array>
<string>OSX</string>
</array>
<key>IsXcodeManaged</key>
<false/>
<key>DeveloperCertificates</key>
<array>
<data>XXXXXXXXXXXXXXXXX</data>
</array>
<key>Entitlements</key>
<dict>
<key>keychain-access-groups</key>
<array>
<string>XXXXXXX.*</string>
</array>
<key>com.apple.application-identifier</key>
<string>XXXXXXXXX.*</string>
<key>com.apple.developer.team-identifier</key>
<string>XXXXXXXXXX</string>
</dict>
<key>ExpirationDate</key>
<date>2020-02-19T22:11:57Z</date>
<key>Name</key>
<string>dev</string>
<key>ProvisionedDevices</key>
<array>
<string>XXXX-UUID</string>
</array>
<key>TeamIdentifier</key>
<array>
<string>XXXXXXXX</string>
</array>
<key>TeamName</key>
<string>Name Surname</string>
<key>TimeToLive</key>
<integer>365</integer>
<key>UUID</key>
<string>YYYYYYY-UNKNOWN-UUID</string>
<key>Version</key>
<integer>1</integer>
</dict>
</plist>%
debug output:
/opt/bin/organize-my-files develop ● time DEBUG=electron-builder electron-builder -m
• electron-builder version=20.38.5
• loaded configuration file=package.json ("build" field)
• effective config config=
directories:
output: release-builds
buildResources: build
appId: XXXXXXXXXXXXXXXX
snap:
confinement: classic
mac:
target:
- mas-dev
category: public.app-category.productivity
mas:
category: public.app-category.productivity
entitlements: build/entitlements.mas.plist
linux:
target:
- AppImage
- snap
win:
target:
- nsis
- portable
- appx
certificateFile: cert.pfx
icon: build/icon.ico
• writing effective config file=release-builds/builder-effective-config.yaml
• no native production dependencies
• packaging platform=mas arch=x64 electron=4.0.5 appOutDir=release-builds/mas-dev
• spawning command=/usr/local/lib/node_modules/electron-builder/node_modules/app-builder-bin/mac/app-builder unpack-electron --configuration [{"platform":"mas","arch":"x64","version":"4.0.5"}] --output /opt/bin/organize-my-files/release-builds/mas-dev --distMacOsAppName Electron.app
• map async taskCount=2
• map async taskCount=1
• map async taskCount=206
• fix permissions file=/opt/bin/organize-my-files/release-builds/mas-dev/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions newPermissions=rwxr-xr-x originalPermissions=rwxr--r-- reason=group or other cannot read
• fix permissions file=/opt/bin/organize-my-files/release-builds/mas-dev/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A newPermissions=rwxr-xr-x originalPermissions=rwxr--r-- reason=group or other cannot read
• exited command=app-builder code=0 pid=6067
• spawning command=/usr/local/lib/node_modules/electron-builder/node_modules/app-builder-bin/mac/app-builder node-dep-tree --dir /opt/bin/organize-my-files
• unresolved deps nodeModuleDir=/opt/bin/organize-my-files/node_modules round=0 unresolved=mkdirp
• unresolved deps nodeModuleDir=/opt/bin/node_modules round=1 unresolved=mkdirp
• unresolved deps nodeModuleDir=/opt/bin/organize-my-files/node_modules round=0 unresolved=inflight, inherits, minimatch, once, path-is-absolute
• unresolved deps nodeModuleDir=/opt/bin/node_modules round=0 unresolved=once
• unresolved deps nodeModuleDir=/opt/bin/node_modules round=0 unresolved=wrappy
• unresolved deps nodeModuleDir=/opt/bin/organize-my-files/node_modules round=0 unresolved=brace-expansion
• unresolved deps nodeModuleDir=/opt/bin/node_modules round=1 unresolved=brace-expansion
• unresolved deps nodeModuleDir=/opt/bin/node_modules round=0 unresolved=minimatch
• unresolved deps nodeModuleDir=/opt/bin/node_modules round=0 unresolved=inherits
• unresolved deps nodeModuleDir=/opt/bin/node_modules round=0 unresolved=safe-buffer
• unresolved deps nodeModuleDir=/opt/bin/organize-my-files/node_modules round=0 unresolved=graceful-fs, universalify
• unresolved deps nodeModuleDir=/opt/bin/node_modules round=1 unresolved=graceful-fs,
• unresolved deps nodeModuleDir=/opt/bin/organize-my-files/node_modules round=0 unresolved=graceful-fs
• unresolved deps nodeModuleDir=/opt/bin/node_modules round=1 unresolved=graceful-fs
• unresolved deps nodeModuleDir=/opt/bin/organize-my-files/node_modules round=0 unresolved=graceful-fs
• unresolved deps nodeModuleDir=/opt/bin/node_modules round=1 unresolved=graceful-fs
• unresolved deps nodeModuleDir=/opt/bin/organize-my-files/node_modules round=0 unresolved=minimist
• unresolved deps nodeModuleDir=/opt/bin/node_modules round=0 unresolved=path-is-absolute, inflight, inherits, minimatch, once
• unresolved deps nodeModuleDir=/opt/bin/organize-my-files/node_modules round=0 unresolved=abbrev
• exited command=app-builder code=0 pid=6069 out=[{"dir":"/opt/bin/node_modules","deps":["balanced-match","brace-expansion","concat-map","graceful-fs","inflight","inherits","minimatch","mkdirp","natives","once","path-is-absolute","safe-buffer","wrappy"]},{"dir":"/opt/bin/organize-my-files/node_modules","deps":["abbrev","about-window","async","balanced-match","brace-expansion","bytes","chart.js","chartjs-color","chartjs-color-string","color-convert","color-name","concat-map","core-util-is","filesize","fs-extra","fs.realpath","get-folder-size","glob","graceful-fs","inflight","inherits","isarray","lodash","lodash.deburr","makeerror","mime","minimatch","minimist","mkdirp","moment","mv","once","open","parse-listing","path-is-absolute","process-nextick-args","readable-stream","readdirp","recursive-readdir","safe-buffer","set-immediate-shim","string-pixel-width","string_decoder","sudo-prompt","tmpl","touch","universalify","util-deprecate","walker","wrappy"]},{"dir":"/opt/bin/node_modules/mkdirp/node_modules","deps":["minimist"]},{"dir":"/opt/bin/organize-my-files/node_modules/fs-extra/node_modules","deps":["jsonfile"]},{"dir":"/opt/bin/organize-my-files/node_modules/get-folder-size/node_modules","deps":["async"]},{"dir":"/opt/bin/organize-my-files/node_modules/mkdirp/node_modules","deps":["minimist"]},{"dir":"/opt/bin/organize-my-files/node_modules/mv/node_modules","deps":["glob","ncp","rimraf"]},{"dir":"/opt/bin/organize-my-files/node_modules/recursive-readdir/node_modules","deps":["minimatch"]},{"dir":"/opt/bin/organize-my-files/node_modules/touch/node_modules","deps":["nopt"]}]
• spawning command=/usr/local/lib/node_modules/electron-builder/node_modules/app-builder-bin/mac/app-builder icon --format icns --root /opt/bin/organize-my-files/build --root /opt/bin/organize-my-files --out /opt/bin/organize-my-files/release-builds/.icon-icns
• path resolved outputFormat=icns path=/opt/bin/organize-my-files/build/icon.icns
• exited command=app-builder code=0 pid=6071 out={"icons":[{"file":"/opt/bin/organize-my-files/build/icon.icns","size":0}],"isFallback":false}
• executing file=security args=find-identity -v
• executing file=security args=find-identity -v -p codesigning
• executed file=security stdout=
1) XXXXXXB537 "3rd Party Mac Developer Application: Name Surname (XXXXXXXXXX)"
2) XXXXXXE8F6 "Developer ID Application: Name Surname (XXXXXXXXXX)"
3) XXXXXX69E4 "Mac Developer: Name Surname (XXXXXXXXXX)"
3 valid identities found
• executed file=security stdout=
1) XXXXXXB537 "3rd Party Mac Developer Application: Name Surname (XXXXXXXXXX)"
2) XXXXXXFF81 "3rd Party Mac Developer Installer: Name Surname (XXXXXXXXXX)"
3) XXXXXXE8F6 "Developer ID Application: Name Surname (XXXXXXXXXX)"
4) XXXXXX23A2 "Developer ID Installer: Name Surname (XXXXXXXXXX)"
5) XXXXXX69E4 "Mac Developer: Name Surname (XXXXXXXXXX)"
5 valid identities found
• signing file=release-builds/mas-dev/Organize My Files.app identityName=Mac Developer: Name Surname (XXXXXXXXXX) identityHash=XXXXXXXXXXXXXXXXX69E4 provisioningProfile=none
DEBUG=electron-builder electron-builder -m 9.49s user 2.40s system 96% cpu 12.286 total
The main questions are:
- How to test the app locally before sending it to Mac App Store?
- What else can I do on my side to fix all pain and tears issues while submitting to MAS?
@develar i will appreciate if you can have a look on this. I will be very grateful for any advices
Reads:
- https://www.electron.build/configuration/mas
- https://github.com/sethlu/electron-distribution-guide/blob/master/MacAppStoreDeployment.md
- https://github.com/sethlu/electron-distribution-guide/blob/master/DevelopmentSignedApplication.md
- https://github.com/electron-userland/electron-osx-sign/wiki
- https://medium.com/@jondot/shipping-electron-apps-to-mac-app-store-with-electron-builder-e960d46148ec
- https://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
Refs:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:8 (1 by maintainers)
Top GitHub Comments
This has been fixed. Thanks for your help guys.
@vasyl-shumskyi How did you solve it? I have the same problem