Linux build on Linux fails when converting icons
See original GitHub issue- Version: latest
- Target: mac, linux, win
I have a problem with icons on Linux. I am getting the following error when builing AppImage or .deb from Ubuntu:
Unhandled rejection Error: Exit code: 1. Command failed: gm convert -size 48x48 /tmp/electron-builder-YSxxWJ/0-2-linux.iconset/icon_256x256x32.png -resize 48x48 /tmp/electron-builder-YSxxWJ/0-2-linux.iconset/icon_48x48x32.png
gm convert: Unable to open file (/tmp/electron-builder-YSxxWJ/0-2-linux.iconset/icon_256x256x32.png) [No such file or directory].
It happens when the Linux icons are being generated from mac .icns file. I tried recreating the .icns
file with different tools and it fails with all of them.
My electron-builder.yml
looks like this:
appId: App
directories:
buildResources: resources
output: release
mac:
icon: "./resources/mac/app.icns"
dmg:
background: "./resources/mac/dmg.tiff"
icon: "./resources/mac/app.icns"
iconSize: 138
win:
icon: "./resources/win/app.ico"
timeStampServer: "http://tsa.starfieldtech.com"
linux:
target:
- deb
- rpm
- AppImage
...
The full output from debug mode is here.
Issue https://github.com/electron-userland/electron-builder/issues/239 seems to be related, however I tried adding 48x48 icon and others too and it did not work. I checked versions of icns2png
on a Mac (where the icns was built) and the Linux machine and both are 1.5
. I even tried regenerating the icons online with iconverticons.com as you suggested in https://github.com/electron-userland/electron-builder/issues/239#issuecomment-235655131.
I also tried adding separate build/icons
directory with PNGs of all sizes as you mentioned in #1154, but this is ignored when I have the mac
section with icons
in my config. I also tried removing the mac stuff and it did not work anyway, the default electron icon was used anyway. Can it be because I am using electron-builder.yml
instead of having the config in package.json
?
Anyway, I would prefer having a separate icon
or icons
field in linux
config, where I would be able to override the autogeneration from mac .icns. The autogeneration would be fine if it worked of course, but it seems to be a bit broken on Linux systems.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
It seems the actual bug in converting .icns files is that the conversion assumes that the file is always named “icon.icns”, whereas in the problem case it was named “app.icns”.
icns2png preserves the name of the .icns file in the extracted .png files, so they end up named as app_256x256x32.png rather than icon_256x256x32.png, which is what the code assumes.
Ok ! thanks !