question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
dsagalcommented, Jul 11, 2017

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.

0reactions
magne4000commented, Jul 21, 2017

Ok ! thanks !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash when using custom icon theme on Linux - GitLab
I have a custom icon theme. It uses some icons from the Papirus icon theme but inherits all other icons from the default...
Read more >
Icon 'unknown' not present in theme - Plastic SCM on Linux
The errors are due to a missing icon in your current GTK icon theme (as the error messages say). One workaround is trying...
Read more >
8.1. General — Code Composer Studio 12.1.0 Documentation
My username has Unicode characters and CCS fails to install. How do I resolve this?¶. Please see this FAQ. 8.2.5. Why does the...
Read more >
Windows Icons to Linux (converting) - Ubuntu Forums
I made a script that first takes spaces out of the icons names and replaced them with underscores, then added the change name...
Read more >
Building the JDK - OpenJDK
If configure fails due to missing dependencies (to either the toolchain, build tools, ... It's possible to build both Windows and Linux binaries...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found