kmp-project-structure

Solid

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.

AI & Automation 4 stars 0 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 83/100

Stars 20%
23
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# 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...

Details

Author
iammohdzaki
Repository
iammohdzaki/kmp-skills
Created
1 months ago
Last Updated
2 days ago
Language
PowerShell
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category