How can I set icon for macos application? By `info...
# kotlin-native
a
How can I set icon for macos application? By
info.plist
I’ve set icon for application in Launchpad, file -
/Applications/my.app/Contents/Resources/main.icns
If I try to set by
Copy code
val iconUrl = NSURL(fileURLWithPath = "file:///Applications/my.app/Contents/Resources/main.icns")
app.setApplicationIconImage(NSImage(contentsOfURL = iconUrl))
I have NPE If I try to set by
Copy code
val iconUrl = NSURL(fileURLWithPath = "file:///Applications/my.app/Contents/Resources/main.icns")
app.setApplicationIconImage(NSImage(byReferencingURL = iconUrl))
I have error
Copy code
Cannot lock focus on image <NSImage 0x7f9d75af1370 Size={0, 0} Reps=()>, because it is size zero.
How I can set icon?