Set up a new Kotlin Multiplatform with Compose Project

Apr 28, 2024

Recently, I set up a new Kotlin Multiplatform (formerly a.k.a. Kotlin Multiplatform Mobile) with Compose (a.k.a. Jetpack Compose for Android, and JetBrains Compose for Multiplatform). A year ago, the last time I did that, it was quite cumbersome, and as I experience now, it still is. As of April 2024, there is still no IDE wizard that allows you to create a new Kotlin Multiplatform project with mobile and desktop apps. There is an option for “Compose for Desktop” in IntelliJ with the Compose Multiplatform IDE Support plugin, or a “Kotlin Multiplatform App” option for iOS and Android apps using the Kotlin Multiplatform Mobile plugin in Android Studio. But not one that allows to setup the

Useful Resources

  • Official Tutorial: If you’re about to set up your first Kotlin Multiplatform project, I strongly recommend going through the official “Get started with Kotlin Multiplatform — tutorial”. It includes all the prerequisites, checking the environment with kdoctor, and possible issues and solutions.
  • Kotlin Multiplatform Wizard: This is the closest to a “new project” wizard as it gets. Just without the IDE integration. Specify the platforms you want to target (Android, iOS, Desktop, Web, Server), and download the project structure as a .zip file.
  • compose-multiplatform-template: A project template or reference project with an Android, iOS, and Desktop app with a shared UI.
  • compose-multiplatform examples: A collection of a few simple example apps that make use of Kotlin Multiplatform.
  • App Icon for Desktop: For customizing app icons, you need a configuration in gralde, an .icns file for macOS, .ico for Windows, and .png for Linux. To create an .icns file from a regular image, open the image in Preview, FileExport, hold Option ⌥ (adds new file formats), select “ICNS” as file format, and export. To create an .ico file, one easy option is an online converter, e.g. icoconvert.com.

I hope you found a few interesting resources here. Let me know if there is something I should add.

You might also like