13

I'm trying to make an iconset for an application, but keep on getting an error when I make it: Hexchat.iconset:error: Failed to generate ICNS.

I tried both exporting .png files individually from Illustrator, as well as using a script. Current script with a 1024x1024 png file as Hexchat_8.png is:

mkdir Hexchat.iconset
sips -z 16 16     Hexchat_8.png --out Hexchat.iconset/hexchat_16x16.png
sips -z 32 32     Hexchat_8.png --out Hexchat.iconset/hexchat_16x16@2x.png
sips -z 32 32     Hexchat_8.png --out Hexchat.iconset/hexchat_32x32.png
sips -z 64 64     Hexchat_8.png --out Hexchat.iconset/hexchat_32x32@2x.png
sips -z 128 128   Hexchat_8.png --out Hexchat.iconset/hexchat_128x128.png
sips -z 256 256   Hexchat_8.png --out Hexchat.iconset/hexchat_128x128@2x.png
sips -z 256 256   Hexchat_8.png --out Hexchat.iconset/hexchat_256x256.png
sips -z 512 512   Hexchat_8.png --out Hexchat.iconset/hexchat_256x256@2x.png
sips -z 512 512   Hexchat_8.png --out Hexchat.iconset/hexchat_512x512.png
cp Hexchat_8.png Hexchat.iconset/hexchat_512x512@2x.png
iconutil -c icns Hexchat.iconset
rm -R Hexchat.iconset

Every time it is the same, though, with or without an output file:

iconutil -c icns Hexchat.iconset
Hexchat.iconset:error: Failed to generate ICNS.

iconutil -c icns Hexchat.iconset -o hexchat.icns
Hexchat.iconset:error: Failed to generate ICNS.

chmod'ing and/or sudo doesn't work, and the man page shows no option for verbose error output. What am I doing wrong?

Terekhov
  • 141
  • 1
  • 7

2 Answers2

20

Change your file name from hexchat_16x16.png to icon_16x16.png, and the same for all the other sizes.

I've just had the same error, with names something like myappicon16x16.png and couldn't understand why it was failing.

I would love to take credit for finding this out, but after seeing your question, I found this StackOverflow answer.

Community
  • 1
  • 1
DJH
  • 2,191
  • 4
  • 28
  • 45
  • 1
    Also it's case sensitive - icon_16x16.png, not Icon_16x16.png – AndyTang Nov 13 '18 at 11:33
  • A quick way of seeing whether you have managed to eliminate each and every typo from your icons (I had them as icon_16pt, which also did not work) is to import the .iconset folder into your project and select it. If it works, you can now use the slider to admire your icons at various sizes. If not, you see a sad folder icon, and you WILL get the fail to generate error. – green_knight Oct 17 '19 at 12:29
4

In my case, mac osx app was giving this error when I tried to archive. Naming convention

icon_16x16.png icon_16x16@2x.png icon_32x32.png icon_32x32@2x.png icon_128x128.png icon_128x128@2x.png icon_256x256.png icon_256x256@2x.png icon_512x512.png icon_512x512@2x.png

was correct but I found the alpha = NO for my icons. I exported images again with alpha = Yes and error was fixed.

zeeawan
  • 6,667
  • 2
  • 50
  • 56