When Kotlin Multiplatform is the right choice, and what is actually stable
Kotlin Multiplatform (KMP) lets you write the logic of an app once - business rules, network calls, data access - and compile it for Android, iOS, desktop and server, leaving each platform its own native interface if you want it. The short answer to "is it ready for production?" is yes for the shared logic on Android, iOS, desktop and the JVM server, which the official documentation classifies as Stable; it is no, or not yet, for some parts that many articles present as mature. This text separates the two and gives you a criterion for deciding whether KMP suits your team.
Every stability claim below comes from the JetBrains documentation, read on 2026-11-12. You will find no adoption percentages across companies and no estimates of time saved: there is no public, verifiable measurement to support them, and a figure without a source only decorates. The code examples are in Kotlin, which is not installed on this machine: no listing was compiled or run, and each one is declared as a schema to adapt and to compare with the documentation listed in the Sources.
What the documentation says about stability
JetBrains publishes a table of stability levels per platform, and it has to be read row by row because "Kotlin Multiplatform" and "Compose Multiplatform" are two different things: the first shares the logic, the second shares the interface as well. The table consulted on 2026-11-12 says this.
- Core KMP technology: Android, iOS, desktop JVM and server JVM are Stable; the Web on Kotlin/JS is Stable, on Kotlin/Wasm it is Beta; watchOS and tvOS are Beta.
- Compose Multiplatform (the shared interface): Android, iOS and desktop are Stable; the Web on Kotlin/Wasm is Beta.
- Swift export, the way to expose Kotlin code to Swift without going through Objective-C: it is in Alpha, with possible incompatible changes.
expect/actualclasses: they are in Beta;expect/actualfunctions and properties are not.
The resulting picture is asymmetric, and it matters for decisions. If your plan is "share the logic and keep native interfaces", you rest on Stable components. If the plan includes a web app in Wasm or Swift export without Objective-C, you are betting on pre-stable components, and the documentation itself warns that for Swift export incompatible changes are expected. An article that tells you today "Swift export is stable" is wrong by two levels.
The architecture: what is shared and where it lives
The underlying idea is not "write everything once" but "share what does not depend on the platform". An everyday example: in a booking app, the rule "you cannot book two overlapping slots" is identical on Android and iOS, and rewriting it twice means two bugs to fix twice; the native date picker, instead, is a component that each system does its own way. The first goes into the common code, the second stays native.
Technically the code is organised in source sets: folders of Kotlin sources, each compiled for one or more targets. commonMain compiles for all of them; androidMain and iosMain for the individual platforms. The compiler guarantees that commonMain uses only APIs available on all the targets it is meant for, so you cannot import an Android class by mistake into code that has to run on iOS. The typical layout of a shared module is this.
shared/
└── src/
├── commonMain/kotlin/ # code for all targets
│ ├── domain/ # models, interfaces, use cases
│ ├── data/ # network, database, repositories
│ └── presentation/ # state exposed to the UI
├── commonTest/kotlin/ # tests that run on every target
├── androidMain/kotlin/ # Android only
├── iosMain/kotlin/ # all iOS targets (device and simulators)
└── desktopMain/kotlin/ # JVM desktop only (optional)
androidApp/ # Android app
iosApp/ # Xcode project (Swift/SwiftUI)
Note that iosMain is an intermediate source set: it gathers the code common to iosArm64 (a real iPhone) and iosSimulatorArm64 (the simulator on Apple Silicon). You do not have to create it by hand: the Kotlin Gradle plugin applies a default hierarchy template and generates the intermediate source sets (apple, ios, native) based on the targets you declare. If you add manual dependsOn declarations, the template is disabled with a warning: that is why we do not write them in the second article of the series. You can see where the configuration lives in Configure the First KMP Project.
KMP, Flutter and React Native: what really changes
The difference that decides is where the interface is drawn. Flutter draws every pixel with its own rendering engine, so the app is identical everywhere but does not use the system controls (Flutter rendering is covered in depth in Flutter Performance: Impeller and jank). React Native builds the interface with native components, but the logic runs in JavaScript. KMP, in the "shared logic" configuration, imposes nothing on the interface: each platform uses its own toolkit, and the logic is compiled to native code for each one.
| Criterion | KMP | Flutter | React Native |
|---|---|---|---|
| Language | Kotlin | Dart | JavaScript / TypeScript |
| Interface | Native per platform, or shared Compose Multiplatform | Drawn by the Flutter engine | Native components driven by JavaScript |
| What is shared by default | The logic; the interface only if you choose it | Logic and interface | Logic and, for the most part, interface |
| Most natural entry point | Android/Kotlin team adding iOS | New team or one without a reference platform | Web team with React skills |
The table has no rows on "performance" or on the "share of shared code" as a percentage: these are numbers that depend on the app and that no primary source fixes. What the table does say, defensibly, is the shape of the trade-off. With KMP you share less interface but you do not give up the native look; with Flutter you share almost everything but it is you, not the system, who maintains the appearance; with React Native you reuse web skills but you pay for the crossing between JavaScript and native.
When to choose KMP, and when not
A useful criterion is to ask which constraint is the most rigid in your project. If it is the native look (a banking app that has to feel like part of the system) or the presence of an Android team already expert in Kotlin, KMP is the natural choice. If it is time to market with a team that does not know Kotlin, or the reuse of web skills, the other two tools start with an advantage.
- KMP fits if you already have an Android app in Kotlin and need to bring the same logic to iOS without rewriting it.
- KMP fits if the native interface is a non-negotiable requirement and you want to share only what lies underneath.
- Flutter fits if you start from zero with a small team and want an identical interface on all platforms.
- React Native fits if the team is already strong in React and TypeScript and the app is mostly interface.
These are four independent scenarios, not a ranking. What they share is that the choice follows the skills you have and the constraint you cannot loosen, not the popularity of the tool. If your situation fits none of the four, the decision work is to run a one-week trial on the most complicated feature, not to compare tables.
How Kotlin code reaches Swift
Today the common path to expose the shared module to iOS goes through a framework with an Objective-C interface that Xcode imports like any normal framework. It works, but the generated names are not the ones a Swift developer would write, and suspend functions arrive as callbacks.
// Schema to adapt, not executed: Swift side, with the Objective-C path
let viewModel = UserViewModel()
viewModel.loadUsers { users, error in
// a callback instead of async/await
}
Swift export is JetBrains' answer to this friction, and the documentation says it maps suspend functions to async functions and the Flow types of kotlinx.coroutines to AsyncSequence, that each Kotlin module becomes a Swift module and that Kotlin packages are preserved. It is, however, in Alpha: it supports only final classes that inherit directly from Any, generic types are reduced to their upper bound, and classes that inherit from List, Set or Map are ignored. You enable it with a swiftExport block in Gradle and by replacing, in the Xcode script, the embedAndSignAppleFrameworkForXcode task with embedSwiftExportForXcode.
// Schema to adapt, not executed: build.gradle.kts of the shared module (Swift export, Alpha)
kotlin {
iosArm64()
iosSimulatorArm64()
swiftExport {
moduleName = "Shared" // name of the Swift module that Xcode will import
flattenPackage = "com.example.app" // drops the package prefix from the Swift names
}
}
The two lines that matter are moduleName, which determines how you write import Shared in Swift, and flattenPackage, which otherwise leaves the Kotlin package path in the Swift names as nested enums. If you remove it, everything works but the calls are more verbose. Before adopting it in production, reread the Swift export page because this is exactly the kind of feature whose syntax changes from one version to the next: for an app that has to ship now, the Objective-C path remains the reference, possibly helped by third-party libraries that I have not tried here.
Compose Multiplatform: the shared interface
Compose Multiplatform brings the declarative model of Jetpack Compose to multiple platforms. You write @Composable functions in commonMain and the same ones run on Android, iOS and desktop (stable) and on the Web (Wasm, Beta). It is the choice when you want to share the interface too, accepting that it is not drawn with the system's UIKit or SwiftUI controls.
// Schema to adapt, not executed: commonMain, shared interface
@Composable
fun UserListScreen(
users: List<User>,
onUserClick: (User) -> Unit
) {
LazyColumn {
items(users, key = { it.id }) { user ->
UserCard(user = user, onClick = { onUserClick(user) })
}
}
}
@Composable
fun UserCard(user: User, onClick: () -> Unit) {
Card(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp, vertical = 8.dp)
.clickable(onClick = onClick)
) {
Column(modifier = Modifier.padding(16.dp)) {
Text(user.name, style = MaterialTheme.typography.titleMedium)
Text(user.email, style = MaterialTheme.typography.bodySmall)
}
}
}
Two details of the listing are worth noting. UserListScreen knows no platform: it receives the list and a callback, so it can be tested and previewed without a simulator. And items(users, key = { it.id }) gives each row a stable key: without it, Compose identifies rows by position, and when you insert a user at the top the state of every row (for example a text field inside it) gets attached to the wrong user. The code is the same on Android and iOS, but on iOS the result does not coincide with a SwiftUI app: if that is a requirement, the road of the native interface and the logic-only module remains.
A shared repository, with the coroutine trap
The typical example of shared logic is a repository that tries the network and falls back on the local copy. The schema below uses Ktor for the network and SQLDelight for the database; UserDto, AppDatabase and the userQueries queries are types that SQLDelight generates from your schema, so the listing cannot be compiled on its own. The design choice is network first, then cache: the opposite case (reading the cache and never updating it unless it is empty) leaves the user with stale data indefinitely.
// Schema to adapt, not executed: commonMain
class UserRepositoryImpl(
private val httpClient: HttpClient,
private val database: AppDatabase,
private val baseUrl: String
) : UserRepository {
override suspend fun getUsers(): List<User> =
try {
val remote = httpClient.get("$baseUrl/users").body<List<UserDto>>()
database.userQueries.transaction {
remote.forEach { database.userQueries.insert(it.toEntity()) }
}
remote.map { it.toDomain() }
} catch (e: CancellationException) {
throw e // never swallow the cancellation of the coroutine
} catch (e: Exception) {
database.userQueries.selectAll().executeAsList().map { it.toDomain() }
}
}
The line that separates a correct repository from one that only seems to work is catch (e: CancellationException) { throw e }. In Kotlin the cancellation of a coroutine is an exception: if a catch (e: Exception) catches it and turns it into a fallback on the cache, the coroutine keeps working after being cancelled (for example when the user leaves the screen). The transaction block groups the inserts into a single write, avoiding writing to disk one row at a time. If you remove the second catch, a network error becomes an exception for the caller, which may be intended: it depends on what you want to show the user when offline.
The libraries you really need
An ecosystem of multiplatform libraries is what makes KMP usable beyond the example. There are four categories that almost every project covers, and for each one there is a library with a common target and platform-specific engines.
- Network: Ktor Client, with the
OkHttpengine on Android and JVM and theDarwinengine (which usesNSURLSession) on iOS. - Serialisation:
kotlinx.serialization, which reads and writes JSON from the same common code. - Database: SQLDelight, which generates Kotlin code from SQL queries and has a driver per platform.
- Dependency injection: Koin, written in pure Kotlin and therefore usable in common code.
This list matters mostly for its pattern: the library sits in commonMain, the engine or driver in the platform source sets. That point is where new projects break most often, and it is the subject of the second article, where you see the complete Gradle blocks. The rule for adding a dependency is to check that it declares the iOS target: a JVM-only library does not compile for iOS.
What really weighs on adoption in a team
Before looking for benefits, it is worth listing the costs, because they are the ones that surprise. I kept three, all verifiable by trying the project for a few days, with no need for a statistic.
- Gradle: the configuration of targets and source sets is the part where the team loses most time at the start.
- Libraries: every dependency must have the iOS target; a Java-only library stops at the boundary between Android and iOS.
- Compile times: compiling for iOS (Kotlin/Native) is slower than for the JVM, so it is worth running the logic tests on the JVM and reserving the iOS ones for native cases.
None of these costs is a reason to give up, but all of them are reasons to start small: one shared module, one real feature (for example the parsing and validation of a complex form), measuring as a team how much time it takes in the first sprint. An adoption that starts from the hardest logic, and not from the whole app, tells you in two weeks whether the tool is right for you.
Frequently asked questions
Is Kotlin Multiplatform stable for production?
Yes for the core: the official documentation classifies Android, iOS, desktop JVM and server JVM as Stable. Not every part around it is: the Web on Wasm is Beta, Swift export is Alpha and expect/actual classes are Beta.
Is Compose Multiplatform the same as Kotlin Multiplatform?
No. Kotlin Multiplatform shares the logic; Compose Multiplatform is the interface toolkit that runs on top and shares it. You can use the first without the second, keeping native interfaces.
Can I call Kotlin code from Swift with async/await?
With Swift export, yes: suspend functions become async and Flow becomes AsyncSequence. But Swift export is in Alpha, so for a production app the reference remains the Objective-C framework, with its callbacks.
What you can do now
You can read the stability table and tell apart what you can build on (shared logic, Compose on Android, iOS and desktop) from what is still pre-stable (Wasm, Swift export, expect/actual classes). You can explain in one sentence the difference from Flutter and React Native, and choose according to the most rigid constraint of your project. In the second article, Configure the First KMP Project, you move on to the Gradle configuration; in the third, Shared Module Architecture, you see how to structure the shared module. If you come from Flutter, Platform Channels: Swift and Kotlin shows the other way of talking to native code.
Sources
- Stability of supported platforms (kotlinlang.org) - table of stability levels per platform; consulted on 2026-11-12.
- Compose Multiplatform and Jetpack Compose (jetbrains.com) - stability of Compose Multiplatform for Android, iOS, desktop and Web; consulted on 2026-11-12.
- Interoperability with Swift using Swift export (kotlinlang.org) - Alpha status, suspend and Flow mappings, limits, Xcode tasks; consulted on 2026-11-12.
- Hierarchical project structure (kotlinlang.org) - default hierarchy template and intermediate source sets; consulted on 2026-11-12.
- Ktor client engines (ktor.io) - OkHttp and Darwin engines per platform; consulted on 2026-11-12.
Commenti
Caricamento commenti...
Sign in to comment