← ClaudeAtlas

kmp-project-structurelisted

Reference skill for the new recommended KMP project structure (2026+). Covers the shift from the old single-module composeApp layout to the new multi-module shared/ + androidApp/ + desktopApp/ structure required for AGP 9.0+. Includes full file and Gradle configuration for both old and new layouts.
iammohdzaki/kmp-skills · ★ 2 · AI & Automation · score 81
Install: claude install-skill iammohdzaki/kmp-skills
# KMP Project Structure (2026+) > **IMPORTANT — Structure Changed** > > The KMP project structure has changed significantly. The old single-module layout where > `composeApp` held both shared code and the Android app entry point is **deprecated** and > incompatible with AGP 9.0+. > > Always scaffold new projects using the **new multi-module layout** described in this skill. > Use the [KMP Wizard](https://kmp.jetbrains.com/) to generate a reference project if unsure. --- ## Old vs New Structure ### Old Structure (pre-2026 / AGP < 9.0) — Do NOT use for new projects ``` MyApp/ ├── composeApp/ ← ⚠️ Mixed: shared code + Android app entry point │ ├── build.gradle.kts ← applies com.android.application + kotlin.multiplatform │ └── src/ │ ├── commonMain/kotlin/… │ ├── androidMain/kotlin/… ← MainActivity lives here │ └── jvmMain/kotlin/… ├── iosApp/ ← Xcode project ├── gradle/libs.versions.toml ├── build.gradle.kts └── settings.gradle.kts ``` **Problem**: AGP 9.0 forbids `com.android.application` (or `com.android.library`) from coexisting with `org.jetbrains.kotlin.multiplatform` in the same module. --- ### New Structure (AGP 9.0+ / KMP 2.2+) — Use this for all new projects ``` MyApp/ ├── shared/ ← KMP library module (all shared code + shared UI) │ ├── build.gradle.kts ← applies com.android.kotlin.multiplatform.library + kotlin.multiplatf