Kotlin Multiplatform (KMP) Guide
android_kmp_guideProvides Kotlin Multiplatform reference to share business logic across Android and iOS. Covers KMP-specific libraries, Room, Ktor, and platform code patterns.
Instructions
Complete Kotlin Multiplatform reference — shares business logic across Android and iOS. CRITICAL: AI tools silently generate Android-only code for KMP projects. Retrofit cannot be used in KMP (use Ktor). Hilt cannot be used in commonMain (use Koin). Room 2.7+ has KMP support — use room-runtime + sqlite-bundled, NOT the Android-only Room. 900+ new KMP libraries in 2025. Room, DataStore, Ktor all have KMP variants. Topics: 'overview' (project structure, Gradle setup), 'libraries' (KMP catalogue — Ktor, Room KMP, DataStore KMP, Koin, Coil3, kotlinx-*), 'room' (Room KMP database setup), 'ktor' (Ktor HTTP client — replaces Retrofit), 'expect actual' (platform-specific code pattern).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | No | Topic: 'overview', 'libraries', 'room', 'ktor', 'expect actual', 'gradle' |