Framework symlinks are not created in app on macOS, leading to crash on launch
See original GitHub issue- Version: 20.29.0
- electron-updater version: 3.1.5
- Target: macOS
When I build my app, whether with electron-builder --dir
(pack) or build -p always
(publish), my resulting build sometimes instantly crashes. I run the app by opening the resulting .app
.
The crash reports are as follows:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: DYLD, [0x1] Library missing
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
Library not loaded: @rpath/Electron Framework.framework/Electron Framework
Referenced from: /Applications/myapp.app/Contents/MacOS/myapp
Reason: image not found
or
Dyld Error Message:
Library not loaded: @rpath/Mantle.framework/Mantle
Referenced from: /Applications/myapp.app/Contents/MacOS/myapp
Reason: image not found
After looking at this issue further, the frameworks under myapp.app/Contents/Frameworks
are sometimes not symlinked correctly. That is, sometimes all symlinks are present, sometimes the symlink for Electron Framework.framework
is missing, sometimes the symlink for Mantle.framwork
is missing and so on.
Here is an example where Mantle.framework
is correctly symlinked, but Electron Framework.framework
not.
$ pwd
/Applications/myapp.app/Contents/Frameworks/Mantle.framework
$ ll
total 0
drwxr-xr-x 7 vladh staff 224B Oct 31 12:19 .
drwxr-xr-x 9 vladh staff 288B Oct 31 12:17 ..
lrwxr-xr-x 1 vladh staff 24B Oct 31 12:19 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 vladh staff 23B Oct 31 12:19 Mantle -> Versions/Current/Mantle
lrwxr-xr-x 1 vladh staff 24B Oct 31 12:19 Modules -> Versions/Current/Modules
lrwxr-xr-x 1 vladh staff 26B Oct 31 12:19 Resources -> Versions/Current/Resources
drwxr-xr-x 4 vladh staff 128B Oct 31 12:19 Versions
$ pwd
/Applications/myapp.app/Contents/Frameworks/Electron Framework.framework
$ ll
total 0
drwxr-xr-x 5 vladh staff 160B Oct 31 12:19 .
drwxr-xr-x 9 vladh staff 288B Oct 31 12:17 ..
lrwxr-xr-x 1 vladh staff 26B Oct 31 12:19 Libraries -> Versions/Current/Libraries
lrwxr-xr-x 1 vladh staff 26B Oct 31 12:19 Resources -> Versions/Current/Resources
drwxr-xr-x 4 vladh staff 128B Oct 31 12:19 Versions
Here is my stripped package.json
:
{
"name": "myapp",
"productName": "My App",
"version": "1.0.18",
"main": "src/main/index.js",
"private": "true",
"scripts": {
"start": "electron .",
"devstart": "electron . --debug",
"build": "webpack",
"devbuild": "webpack --watch",
"test": "mocha && standard",
"package": "npm-run-all package:*",
"postinstall": "electron-builder install-app-deps",
"package:mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --out=out --icon=dist/app-icon/mac/app.icns --osx-sign.identity='Developer ID Application: GitHub' --extend-info=dist/mac/info.plist",
"package:win": "electron-packager . --overwrite --platform=win32 --arch=ia32 --out=out --icon=dist/app-icon/win/app.ico",
"package:linux": "electron-packager . --overwrite --platform=linux --arch=x64 --out=out",
"package:sign-exe": "signcode './out/Electron API Demos-win32-ia32/Electron API Demos.exe' --cert ~/electron-api-demos.p12 --prompt --name 'Electron API Demos' --url 'http://electron.atom.io'",
"package:installer": "node ./script/installer.js",
"package:sign-installer": "signcode './out/windows-installer/ElectronAPIDemosSetup.exe' --cert ~/electron-api-demos.p12 --prompt --name 'Electron API Demos' --url 'http://electron.atom.io'",
"prepack": "check-for-leaks",
"prepush": "check-for-leaks",
"publish": "build -p always",
"pack": "electron-builder --dir",
"dist": "electron-builder"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"apply-loader": "^2.0.0",
"babel-loader": "^8.0.2",
"check-for-leaks": "^1.2.0",
"css-loader": "^1.0.0",
"devtron": "^1.3.0",
"electron": "^2.0.4",
"electron-builder": "^20.29.0",
"electron-packager": "^12.1.0",
"electron-winstaller": "^2.2.0",
"html-webpack-plugin": "^3.2.0",
"husky": "^0.14.3",
"mocha": "^5.2.0",
"npm-run-all": "^4.0.2",
"path": "^0.12.7",
"pug": "^2.0.3",
"pug-loader": "^2.4.0",
"request": "^2.70.0",
"signcode": "^0.5.0",
"spectron": "^3.8.0",
"standard": "^8.2.0",
"style-loader": "^0.23.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"vue-devtools": "^5.0.0-beta.1",
"webpack": "^4.17.2",
"webpack-cli": "^3.1.0",
"webpack-livereload-plugin": "^2.1.1"
},
"dependencies": {
"electron-log": "^2.2.14",
"electron-pug": "^2.0.0",
"electron-settings": "^3.0.7",
"electron-shortcut-normalizer": "^1.0.0",
"electron-updater": "^3.1.5",
"glob": "^7.1.0",
"he": "^1.2.0",
"highlight.js": "^9.3.0",
"lodash": "^4.17.11",
"serialport": "^7.0.2",
"sqlite3": "https://github.com/mapbox/node-sqlite3/tarball/master",
"update-electron-app": "^1.1.1",
"vue": "^2.5.17",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"standard": {
"env": {
"mocha": true
}
},
"build": {
"appId": "com.example.myapp",
"extraResources": [
"data"
],
"files": [
"build",
"config/*.js",
"src",
"static"
],
"publish": [
{
"provider": "spaces",
"name": "releases",
"region": "ams3"
}
]
},
}
In effect, my app’s builds randomly do not start because of these missing symlinks.
Any help would really be appreciated! Please let me know if any other info is required and I’ll provide it right away.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:11 (5 by maintainers)
@develar Everything works for my use case on Electron 2 — thanks so much for the fix!
Hey @develar,
we just experienced this issue with version 4.0.19 of Now Desktop.
The binaries are now replaced, but you can find the old information here:
Restarting the Circle CI workflow fixed it.
We would highly appreciate it if you could take a look at the issue.