Kotlin Multiplatform in a Banking App: Migrating a Large Project Without Breaking It

📺 Recording of the talk by Petr Polívka and Alexander Grigorov from Ackee Meets: Mobile Development (in Czech):
On paper, Kotlin Multiplatform sounds like a dream: “We'll shove the logic into KMP, iOS plugs in, and we're done.” That's exactly how the iOS developers imagined it at the start: the Android folks would do all the heavy lifting, they would chill and then just hook up the UI. The project managers, in turn, counted on saving a lot of money. The reality? Both platforms did the heavy lifting, and the project managers had some rough moments. Here is an honest story of how you migrate a large banking and investment app that has been running for years to Kotlin Multiplatform, with everything that hurt and everything that paid off in the end.
📋 TL;DR
- Kotlin Multiplatform (KMP) is not just “write once and plug in”. For a large existing project, it is mostly migration, architecture and agreement between two platforms over one codebase.
- We shared ViewModels entirely in KMP, and the UI stayed native. iOS consumes the shared code as an XCFramework generated through SKIE, and Koin handles dependencies.
- We didn't go for a monorepo. For a project already in motion, we imported Android as a submodule into the iOS repo.
- We migrated step by step (smallest screen → big feature → migration of Android code) and introduced rules and a merge request process where shared code is also approved by someone from the other platform.
- The biggest traps: Swift concurrency, error handling (Kotlin doesn't tell you what it throws, hence our own
OperationResult) and iPad, which has no counterpart on Android. - After a year in production: 60% of the logic in KMP, 29 shared ViewModels, 43 use cases, no major disasters, and we write new features faster.

This continues the story of sharing code between platforms. If you're still figuring out what KMP is and when it makes sense, start with Kotlin Multiplatform in practice. This article goes one level further, into a large production project.
🏦 Starting point: a large app, two native platforms
We're talking about the mobile app of J&T Banka (a Czech bank) for managing investments and private banking, with roughly 170 screens, native on both platforms. Historically it was focused more on iOS, so most designs were created for iOS first and only then prepared for Android. The design also often differed between the platforms and evolved differently.
What's special? The app has fairly complicated logic: lots of API requests, validation, calculations with amounts. Exactly these things are ideal candidates for sharing. That's why it started to make sense to think about KMP even for a project that had been running for a long time.
🤔 Why we reached for Kotlin Multiplatform after years

The motivation had four parts:
- Faster development. We write part of the logic once instead of twice.
- Consistent behavior. Even though we developed both apps against the same specification, the logic sometimes behaved slightly differently and bugs appeared on only one platform. Sharing logic unifies behavior too.
- Easier future changes. In banking, legislation and requirements change all the time. When something changes in one place, it saves time.
- Bug fixes in one place. Instead of two separate hunts for the same bug.
🧱 KMP architecture: XCFramework, SKIE and shared ViewModels
We chose an XCFramework generated through SKIE. iOS integrates it as a library and uses the shared code. The key decision was to share ViewModels for screens: they live entirely in KMP, the data is mapped to UI objects, and ideally no logic remains in the UI.

public abstract class WalletPaymentViewModel : ViewModel() {
public abstract val screenStateStream: StateFlow<WalletPaymentScreenState>
public abstract val logEventStream: Flow<WalletPaymentLogEvent>
public abstract val navigationEventStream: Flow<WalletPaymentNavigationEvent>
}For screens that haven't been migrated yet (or where it doesn't make sense to migrate them whole), we create use cases that wrap the logic, and both platforms simply use them. Such a use case returns our own OperationResult, and thanks to the @KoinKmmExport annotation, it's easy to get an instance from Koin in Swift:

@KoinKmmExport
public interface GetEnvironmentUseCase {
public operator fun invoke(): OperationResult<AppEnvironment>
}
internal class GetEnvironmentUseCaseImpl(
private val environmentProvider: EnvironmentProvider,
) : GetEnvironmentUseCase {
override fun invoke(): OperationResult<AppEnvironment> =
tryOperation { environmentProvider.current() }
}The modules look like this: a logic module (data and domain models, API queries), a connected presentation module (maps data to UI objects and distributes them to both platforms through a facade) and a testing module (fakes, factories, tests). Because of the gradual migration, the Android module still reaches directly into the logic module for now. Once the whole app is in KMP, that relationship will disappear.
From Swift we also push important things into Koin that we want to use in shared code: formatters (a bank has high demands on handling amounts, so they need to look the same and live in one place) and a native logger, which is also handy for testing.
From previous projects we had experience with a monorepo and wanted to use it here too. In the end we didn't: the project was already running, with a pile of code, high versioning demands and frequent conflicts. So we took the standard route and imported the Android project as a submodule into the iOS code (we already had a submodule dependency for GraphQL there, so nothing new). It's not necessarily the ideal solution forever, but it's enough for now.
🔀 Migrating to KMP step by step

We didn't go in headfirst. The approach was cautious and came in basically three waves:
- The smallest screen in the project. As Petr Polívka describes it, we wanted to verify that we could fetch something and observe changes from the ViewModel. It sounded simple, but even here we hit a snag: the banking network service is really complicated and we had to get two of them running.
- A big feature without migrating Android code. Here we tested more: navigation, bottom sheets, alerts. The goal wasn't to save ourselves the work of migrating but to get a feel for the terrain.
- Refactoring and new features that already required migrating Android code. The last and most painful step.
To make it hurt less, we set up migration rules:
- We treat KMP like a library. What can be
internalstaysinternal, so we expose as little as possible. - We migrate gradually. Having KMP doesn't mean throwing the whole Android project into it and leaving iOS to deal with it.
- Merge request process. When someone touches shared code, they first discuss it with someone from iOS. The person responsible for the same feature on iOS must also join the review of shared code.
“When we had all the steps behind us, the question was how it went. Well, it hurt. And to make it hurt a little less, we made migration rules.”
The iOS reviewer has a simple job: to point out that “this looks nice in Kotlin, but it's awkward to use from Swift, so let's change it”. It can easily happen that on Android we start writing slightly worse code in exchange for it being quite a bit better on iOS. A typical example: instead of a sealed interface, we use a sealed class in Kotlin because it's easier to work with in Swift. Once the shared code gets approval, the reviewer implements it on iOS right away and it merges into both projects at the same time, so we don't end up with Android having something that Swift doesn't (or the other way around).
🕳️ Technical traps of KMP: Swift concurrency, error handling and iPad

Swift concurrency
Swift keeps pulling more things onto the main thread. For example, default actor isolation (in Swift 6.2 and newer) means that Swift code runs on the main thread by default. We turned it on and the app started crashing every time Kotlin tried to touch Swift code. That makes sense: Swift runs asynchronously, but Kotlin doesn't know about it and tries to run it synchronously, which leads to a crash. Similarly, SwiftUI runs on the main thread, but ViewModels from KMP sometimes run elsewhere. It troubled us most with bottom sheets, where a state change didn't propagate in time and the UI jumped several times.
Error handling
In Swift it's a joy: for a function you always know whether it can throw, and the compiler forces you to handle it, even with types now. And then comes Kotlin, where every function can throw anything, and if you mark it wrong, the app crashes. The solution: every use case we use from Swift returns our own OperationResult, either success, or error with a defined structure that we can pass along, or cancellation.
This is probably the most insidious difference from Swift. In shared code it pays to introduce a uniform result wrapper (ours is OperationResult with success / error / cancellation), so that an error reaches the UI as a mapped object and not as an unexpected runtime crash.
iPad (and other platform differences)

The app supports iPad, but not Android tablets. Because of that, ViewModels on iOS sometimes have more functions than on Android. Since we don't want to put into the shared module what Android won't use, for these screens we don't share ViewModels, we share use cases.
There were several other small traps:
- Libraries without KMP support, such as Retrofit or JUnit. Where we could, we migrated to KMP alternatives (Ktor, Kotest). Where we couldn't, we kept the native solution and wrapped it in an abstraction.
- Cascading when moving things. Moving one screen doesn't mean moving only that screen. When you migrate payments, you drag along current accounts, wallets and more. We had to find the boundary for what to migrate and what not, and even split repositories and migrate only the functions needed at the moment.
- Naming conflicts. A
Currencyclass existed on both platforms and caused conflicts after export to iOS. In SKIE, fortunately, this is solved with an annotation and renaming on export (we introduced aSharedprefix). - Resources. We bet on Compose Resources, because we see a bigger future in them.
- UI differences. Bottom sheets, snackbars and tabs behave differently on each platform. We handled them with generic, abstract solutions so they can be reused on other migrated screens too.
For UI components specifically, it looked like this:
| UI element | Android | iOS | Our solution in KMP |
|---|---|---|---|
| Bottom sheet | tied to a specific screen | can be opened from any screen | logic in the ViewModel, one generic model for both platforms |
| Action notification | snackbar | dialog | we send the data and the action to the UI, and each platform renders them its own way |
| Tabs | sliding between tabs (holds data for all tabs) | the whole screen content changes | an abstraction with data about all tabs, which iOS accesses as the state of a single screen |
🧪 What went beautifully: snapshot tests
Because we have shared ViewModels together with UI objects, we can share the generation of data for previews and snapshot tests. So even though the Android and iOS screens look different visually and have different designs, the data content is the same, and we can watch and compare the states of the same screen on both platforms at once. A small gift for all that pain.
🤖 AI in the KMP migration
We already use Claude for everyday implementation, for example to write use cases following established patterns and to write tests for migrated code. Going forward, we're also considering more specialized tools for migrating the rest of the Android code to KMP. (If you're curious how we build this approach in general, take a look at agentic development.)
📈 KMP results after a year in production

The numbers as they stand today:
- 60% of all logic from Android is migrated to KMP.
- 29 shared ViewModels are used across platforms.
- 43 use cases are called directly from Swift code.
- 260 Swift files use shared code one way or another.
- A year and a month in production, and no major problems so far.
So we can finally say KMP pays off and we're really benefiting from it. Whenever we get a new feature now, we think about shared code and write it a bit faster.

After a year in production, definitely yes, but with an asterisk. The payoff didn't come right away; at first it was slower and more painful. It pays off for large, long-term projects with complex logic, where it makes sense to invest in unified behavior and faster development of new features.
Frequently asked questions
success / error / cancellation states. It solves the problem that Kotlin (unlike Swift) doesn't tell you which exception a function throws, so an unhandled error would only crash at runtime.default actor isolation in Swift 6.2 and newer), while ViewModels from KMP may run elsewhere, so state propagation has to be handled explicitly, especially for components like bottom sheets.🎯 Key takeaways
Migrating the J&T Banka banking app to Kotlin Multiplatform isn't about “write once and plug in”. It's gradual work on architecture, rules and communication between two platforms over one codebase. The key is to go in small steps, treat KMP like a library, set up a merge request process involving both platforms, and expect that Swift concurrency, error handling and platform differences will take their toll. The reward is unified behavior, shared tests and noticeably faster development of new features, even though the first migrations really hurt.
You can find the whole story, including questions from the audience, in the talk recording (in Czech). Watch for dates of future Ackee Meets on Eventbrite and subscribe to the newsletter (in Czech) so the next piece like this lands straight in your inbox.




