Problem with .snap files
See original GitHub issueDescribe the bug
For some reason, I cannot install .snap
files built with electron-builder:
yarn electron:build
sudo snap install --dangerous dist_electron/app-name_1.0.0_amd64.snap
I get the following error:
error: cannot install snap file: snap is unusable due to bad permissions; contact developer
I’ve never built / installed .snap
files before, so I’m not sure if I’m doing it right or not.
I manually changed permissions of the snap file to read & write
and selected Allow executing file as program
and then tried to install it again, but I got the same error.
Then I ran journalctl -u snapd
and here’s the last line from it, not sure if that’s what causes the problem:
loka 12 14:59:25 name-VirtualBox snapd[546]: container.go:199: in snap "app-name": "meta/gui/icon.png" should be world-readable, and isn'
Someone opened a similar issue in the electron-builder’s repo: https://github.com/electron-userland/electron-builder/issues/5067
But my problem is I get the error trying to install the .snap
, so even though it gets built successfully, clearly there’s something wrong with the build config and I’m not sure if it’s a problem with vue-cli-plugin-electron-builder
or electron-builder
or if it’s something I’m doing wrong.
vue.config.js
...
builderOptions: {
icon: 'build/icon.png',
snap: {
confinement: 'devmode',
grade: 'devel'
},
linux: {
target: 'snap',
icon: 'build/icon.png',
category: 'system',
maintainer: 'name'
}
...
}
...
Build log
INFO Building app with electron-builder:
• electron-builder version=21.2.0 os=5.4.0-48-generic
• writing effective config file=dist_electron/builder-effective-config.yaml
• rebuilding native dependencies dependencies=diskusage@1.1.3, xxhash-addon@1.3.0 platform=linux arch=x64
• rebuilding native dependency name=diskusage version=1.1.3
• rebuilding native dependency name=xxhash-addon version=1.3.0
• packaging platform=linux arch=x64 electron=10.1.3 appOutDir=dist_electron/linux-unpacked
• building target=snap arch=x64 file=dist_electron/app-name_1.0.0_amd64.snap
DONE Build complete!
Environment:
- OS: Ubuntu 20.04 x64
- electron: 10.1.3
- vue-cli-plugin-electron-builder: 1.4.6 (the issue occurs in the latest 2.0.0-rc.4 as well)
Relevant docs:
Snapcraft: https://snapcraft.io/docs/electron-apps Electron-builder: https://www.electron.build/configuration/snap
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Okay, thanks for testing that. I’ve been pretty busy lately but when I get the chance I’ll test the snap target myself and see if I can figure out what is going wrong.
@nklayman thanks for testing it, mate. I tried that. Turns out, in my case, the cause of the problem had nothing to do with the config properties themselves. For some unimaginable reason, the icon that I specified
build/icon.png
in the config had some read permissions denied (only on Ubuntu as well).I just changed all the file’s permissions to
read & write
, and it got installed successfully after that.