This is an automated archive made by the Lemmit Bot.

The original was posted on /r/androiddev by /u/Mathroda on 2024-09-20 14:30:48+00:00.


Okay, I just got done migrating my app to KMP, and what a hectic journey it was!

I started by migrating some of the libraries to Kotlin libraries, such as:

  • Dagger Hilt → Koin
  • Retrofit → Ktor I left Room and Datastore as they already support Kotlin Multiplatform.

Since my app is multi-module, I had to read a bit more about the Umbrella approach, which basically requires you to transform all your modules to support KMP, with one shared module as the single source of truth connecting everything together. Shoutout to Igor and his app Alkaa!

Things didn’t get easier after that—nothing works out of the box, especially if you’re using the latest Kotlin and Compose versions. I spent a week tracking down an issue on IOS breaking the App to finnaly figure out that a 3rd party library i’m using uses an older version from everything and i made the mistake of not checking out as it was pretty famous. The name starts with the Letter Voyager

So here’s what you need to do before you start migrating:

  • Dive deep and understand Gradle before you begin working on any Kotlin Multiplatform project.
  • Always check 3rd-party libraries, even if they are popular, especially their dependencies and versions.
  • 99% of the time, to make things work on both platforms, you’ll need a workaround. It’s out there, you just need to read those GitHub issues religiously.