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/[email protected]
sips -z 32 32     Hexchat_8.png --out Hexchat.iconset/hexchat_32x32.png
sips -z 64 64     Hexchat_8.png --out Hexchat.iconset/[email protected]
sips -z 128 128   Hexchat_8.png --out Hexchat.iconset/hexchat_128x128.png
sips -z 256 256   Hexchat_8.png --out Hexchat.iconset/[email protected]
sips -z 256 256   Hexchat_8.png --out Hexchat.iconset/hexchat_256x256.png
sips -z 512 512   Hexchat_8.png --out Hexchat.iconset/[email protected]
sips -z 512 512   Hexchat_8.png --out Hexchat.iconset/hexchat_512x512.png
cp Hexchat_8.png Hexchat.iconset/[email protected]
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?

2 Answers 2

21

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.

2
  • 1
    Also it's case sensitive - icon_16x16.png, not Icon_16x16.png
    – AndyTang
    Commented Nov 13, 2018 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. Commented Oct 17, 2019 at 12:29
4

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

icon_16x16.png [email protected] icon_32x32.png [email protected] icon_128x128.png [email protected] icon_256x256.png [email protected] icon_512x512.png [email protected]

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.