-
Notifications
You must be signed in to change notification settings - Fork 98
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
MAS build crashing on launch: Namespace SIGNAL, Code 0x4 #223
Comments
From my understanding you're currently trying to build this for local development and eventually for shipping to the MAS? Let's try the following configuration and see if it works? 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>
<array>
<string>B4X*******.to.go.osx</string>
</array>
<key>com.apple.application-identifier</key>
<string>B4X*******.to.go.osx</string>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist> mas.inherit.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.inherit</key>
<true/>
</dict>
</plist> After getting the app to run locally, we can tackle the submission issue together. |
Some additional context—the forge is configured only for
I've tried running the .app directly as well as install the .pkg signed with 3P Installer as stated here (am I doing this right so far?). I've run the installed app and got the same termination reason. Crashdump:
Build logs:
`codesign` output on the .app
|
Don't think so. The Mac Developer one and the Installer certs are pulled out directly from our org's developer account. Double checked in keychain as well. |
Running these presently on: macOS Catalina 10.15.4 |
@sangeeth96 😂 uhm... Make sure to replace the Also, let's not flatten and install the app for now (unless that already comes together |
^ Sorry that's my mistake... (the buttons are close to each other) |
@sethlu Ha, my bad. 🙈I thought it was fine to show them off since I could see Team IDs of other electron apps installed via Forge build and sign logs:
Crashdump:
If it's of interest, I ran
|
Yea, it's fine if the app bundle doesn't pass the gatekeeper because it's not signed with the Developer ID identity or by Apple. I'm wondering why the crash log is reporting the app at |
I moved it there since launching from output directory is crashing just the same. |
@sethlu One more thing, I've tried versions of Electron from the latest beta to 8 and 7 most recent versions. They were all giving me the same error. For the main application we're building, the DMG gets signed and notarized end-to-end and works fine when opened. Only the MAS is having trouble. The crash dump there is pretty much similar to the ones I posted above. I'm quite puzzled as to why this is happening for even the most basic Electron apps. |
After experimenting with the codesigning utilities a bit, I think that error code is just something generic and it's only coming up for me when I'm wondering why you opted for Somewhat unrelated but interesting notes on Electron 7.1.8
|
@sethlu I put the option in there after going through electron-userland/electron-builder#897 (comment) where you mentioned to opt for this (if building for MAS and want to test it) and manually include the identifier in the entitlements file. I will try again by placing it back in. One other doubt regarding Another request I have is that if you have a working boilerplate setup for getting this codesigned the right way, would love it if you could share it so that I can check it out and see if it works on my end as well. |
I gave The builder config: appId: to.go.osx
productName: Flock
asar: false
forceCodeSigning: false
files: [
'src/',
'node_modules/'
]
mac:
target: [ dir ]
icon: build-assets/mac.icns
helperBundleId: to.go.osx.helper
type: development
identity: null
mas:
entitlements: build-assets/entitlements/mas.plist
entitlementsInherit: build-assets/entitlements/mas.inherit.plist
gatekeeperAssess: false
hardenedRuntime: false
type: development
identity: null With
I did this because of the binary problem and it seems like builder uses a vendored version of this repo. I disabled signing within builder itself. I've reduced the entitlements to the following:
With these, I get the app to start. But, as soon as it tries to create a window, one slowly appears with a white screen and crashes thereafter. The logs from the app:
Crash report here: crash-report.zip So, this seems to point to the Helper (GPU) app. I did try signing that app alone with different sorts of entitlements but none seem to be helping. I did one more thing based on comments from electron/electron#19626, which is to try with |
@sangeeth96 having the same issue. All entitlements are in some strange Running |
@greenimpala Beat me to posting that. We got our app to pass the MAS crash! 🎉 So, here's what seems to be happening: If you check the Apple document related to resolving notarization issues (link here), it is stated that the entitlements file should be in XML format which made me go and dig into the .app package and apply the same reasoning for So, what I did is to let #! /bin/bash
plutil -convert xml1 "$DIST_DIR/Flock.app/Contents/Frameworks/Flock Helper (GPU).app/Contents/Info.plist"
plutil -convert xml1 "$DIST_DIR/Flock.app/Contents/Frameworks/Flock Helper (Plugin).app/Contents/Info.plist"
plutil -convert xml1 "$DIST_DIR/Flock.app/Contents/Frameworks/Flock Helper (Renderer).app/Contents/Info.plist"
plutil -convert xml1 "$DIST_DIR/Flock.app/Contents/Frameworks/Flock Helper.app/Contents/Info.plist"
plutil -convert xml1 "$DIST_DIR/Flock.app/Contents/Info.plist" This will convert all necessary #!/bin/bash
APP_PATH="$DIST_DIR/Flock.app"
BUILD_TYPE="${BUILD_TYPE:-distribution}"
sign_mas_dev () {
npx electron-osx-sign \
--gatekeeper-assess=true \
--hardened-runtime=false \
--type="$BUILD_TYPE" \
--platform=mas \
--entitlements="build/entitlements.mas.plist" \
"$APP_PATH"
};
sign_mas_dev Set values for Related Notes:
I'll go ahead and raise an issue in the CC @sethlu |
I don't understand why during runtime, when the app crashes and we get crash logs, the errors are all cryptic and not pointing straight to the source of the problem—which seems to be the incorrectly encoded |
@sangeeth96 +1 for the detailed instructions :) I now get a launch with mas-dev but an immediate crash (possibly something now with my configuration / app). Will report back. Update: I had a call to |
@sangeeth96 thanks for your step by step post. You are right, I made this try using the electron-quick-start setup so I don't think it can be a problem from my app configuration such as @greenimpala. Any ideas/advises would be welcome guys. Also, I'm a bit confused about the next step of I'm confused because I know only Thanks! |
@Faksprod electron-osx-flat path/to/my.app Similar to However, if you're looking for fancier app flattening tools, I think other folks here will have more up-to-date information 😄 |
@sethlu 👍 Thanks a lot for clarifications! I finally gave a shot back to |
Hi @Faksprod, Thank you for posting the details. I have followed your guide, and apply to electron-quick-start as well the app is not crashing after signing anymore. But now I got a new problem: notarization failed with: I checked my code signing identity:
It seems like missing something. The : 3rd Party Mac Developer Installer. I also created a simple app with Xcode and use Xcode for signing with these certificates and it went through notarization and App Store upload OK. Here's my build config for mac and mas:
I also tried to add to "mac" these config:
But it seems doesn't matter. Full log from apple notarize:
|
@Faksprod same issue here, cant see my 3rd Party Mac Developer Installer |
@le1771 Unfortunately, I won't be able to help you on that point, I never had to Notarize an macOS app yet. My app is only distributed on the Mac App Store so Notarization process is not needed... But this morning I found this article (which I bookmarked just in case of) and it seems well explained and up to date (this article is mentioned on the electron-builder website). I hope it could help you! @SiddharthaM Not sure to understand. Can you see or CAN'T you see your Certificates in your Keychain? If you CAN'T see it in your Keychain, I guess you have to focus on this step first. |
@Faksprod when i do the Both are present in keychain. |
@SiddharthaM The However, it'll show up as a valid certificate here: @le1771 Can you open a new issue & provide a bit more information there for us to troubleshoot? It may not be the same issue that's originally posted here 🤔 |
Thanks @sethlu , that explains the issue. Actual issue got resolved by removing the --deep flags from codesign |
yes works |
Running on:
macOS Catalina 10.15.4
Xcode 11.4, Build version 11E146
I'm trying to build the starter electron app from the guide for MAS but it crashes on launch with the following dump content:
Crash dump:
I'm using
electron-forge
which useselectron-osx-sign
internally (from npm, not vendored) and I've set the debug variable to get the following output:Forge make logs:
The config for
electron-osx-sign
:The entitlements:
mas.plist
mas.inherit.plist
I followed the advise as to set
type
todevelopment
. After changing the entitlements around a bit, the error from #130 was gone but the .app file still crashed as soon it's launched with the above crashdump log. I followed https://developer.apple.com/library/archive/qa/qa1884/_index.html and made the installer pkg signed with 3P Installer and tried installing that to no luck (same error). We had initially submitted the pkg for review before testing it ourselves (we thought we couldn't test the MAS builds) but it got rejected with the note saying the app crashes on launch. So, we tried to start from scratch to understand where things were failing but it's failing from the get go.What are we doing wrong here? I'm hoping this is the right way to go on about testing MAS builds before submitting for review.
The text was updated successfully, but these errors were encountered: