I'm trying to set the icon for a desktop applicati...
# multiplatform
b
I'm trying to set the icon for a desktop application in Kotlin Multiplatform (KMP), but it doesn't seem to be working. I’ve added the icon in the
nativeDistributions
block like this:
Copy code
application {
    nativeDistributions {
        windows {
            iconFile.set(project.file("src/main/resources/app_icon.ico"))
        }
    }
}
However, the icon isn’t changing. I’ve checked that the files are in
src/main/resources/
, and I’m using the correct formats (
.ico
for Windows). I've also tried: Using an absolute file path for the icon. Updating the Compose Multiplatform Gradle plugin. Running
./gradlew clean packageDistributionForCurrentOS
. But no luck so far. Do you have any suggestions or know if there’s another step I might be missing?
m
That’s how I do it and it seems to work.
Copy code
compose.desktop {
    application {
        ...

        nativeDistributions {
            ...
            windows {
                iconFile.set(File("logo/Windows/appIcon.ico"))
                ...
            }
            ...
        }
		...
    }
}
My “logo” directory resides directly inside the “composeApp” directory in a standard setup.
126 Views