kotlinandroid-jetpack-composekotlin-multiplatform

Create exe file from kotlin multiplatform app in intellij IDE


I'm facing a problem trying to export a Kotlin Multiplatform project using compose into one .exe file, that doesn't need jre to start on another computer.

I've already tried to create the .msi installer and I'm able to create a package distribution, but I want to have only one .exe file that I can launch on another PC directly.

Is creating such executable possible? If yes, how can I create one?


Solution

  • I think this will help.

    From the documentation above:

    Use Gradle to generate the .kexe file.

    From the root project directory, run the build command:

    gradle nativeBinaries
    

    This command creates the build/bin/native directory with two directories inside: debugExecutable and releaseExecutable. They contain corresponding binary files.

    Run / locate your .kexe

    By default, the name of the binary file is the same as the project directory. To run the project, execute the following command:

    build/bin/native/debugExecutable/<project_name>.kexe
    

    Note: You will have a .kexe file, but it will work as fine as a .exe file.