Kotlin Multiplatform Tutorial: Build “GuessWhat” for Android, iOS, and Desktop

Build once, run on Android, iOS, and Desktop with Compose Multiplatform

Let’s build something small but complete: GuessWhat. It’s a simple “guess the hidden combination” app, but the main focus is learning Kotlin Multiplatform and Compose Multiplatform — how to organize modules, share code, and run the same app on Android, iOS, and Desktop.

We’ll start from the official Kotlin Multiplatform project template (created either in Android Studio or via the JetBrains KMP Wizard) and then build it up step by step.

Let’s get started

  1. Open Android StudioFile → New → New Project.
  1. Select Kotlin MultiplatformNext.
  1. Set:
    • Name: GuessWhat-KMP
    • Package name: me.mitkovic.guesswhat
    • For the project location, pick a GuessWhat-KMP folder somewhere on your computer.
    • Next
  1. Make sure the targets include Android, iOS, and Desktop (also Share UI).
    We will add tests later. Don’t include them now.
  2. Click Finish and let Gradle sync complete.
  3. In Android Studio, in the top left corner (to the right of the Project folder icon), pick Project from the drop-down menu.
    In the Android Studio Terminal, type: git init
    Enter
  1. In Android Studio, in the top right corner, below the Project icon, you will now see the Commit tab:
  1. Select all files and type in the box below: Initial commit
    Click the Commit button.
    Let Git do its work.
  2. After the initial commit, let’s make sure the project runs on all targets.

    Android and Desktop should run out of the box, but iOS may need two small fixes depending on your Mac/Xcode setup:
    • In composeApp/build.gradle.kts, add iosX64() to the iOS targets list to support the iOS Simulator on Intel Macs.
listOf(
    iosX64(), // Intel Mac simulator
    iosArm64(), // Real iOS device
    iosSimulatorArm64(), // Apple Silicon Mac simulator
).forEach { iosTarget ->
    iosTarget.binaries.framework {
        baseName = "ComposeApp"
        isStatic = true
    }
}
  1. Open iosApp in Xcode
    • In target iosApp → Build Settings → Architectures
    • Change Architectures (ARCHS) to Standard Architectures
    • Xcode will then write ARCHS = “$(ARCHS_STANDARD)” into project.pbxproj
  1. Verify that app runs everywhere:
    • Android ✅
    • Desktop ✅
    • iOS ✅

Next…

Leave a Reply