Multiplatform

Kotlin Multiplatform Is Stable and Production-Ready

Read this post in other languages:

In a highly anticipated move, Kotlin Multiplatform, an open-source technology built by JetBrains that allows developers to share code across platforms while retaining the benefits of native programming, has become Stable and is now 100% ready for use in production.

Read on to learn about the evolution of Kotlin Multiplatform (KMP), how it can streamline your development process, and what educational resources are available for you to get the most out of the technology.

Get Started

Share code on your terms, with confidence

Designed with a core focus on flexibility and adaptability, Kotlin Multiplatform (KMP) blurs the boundaries between cross-platform and native development. It allows developers to reuse as much code as they want, write native code if and as needed, and seamlessly integrate shared Kotlin code into any project.

Since the first release of KMP, its flexibility has attracted many prominent companies, such as Netflix, Philips, McDonald’s, 9GAG, and Baidu. Many teams have already been capitalizing on KMP’s ability to be gradually integrated, as well as its low adoption risk. Some of them share isolated critical parts of their existing Kotlin code to improve the stability of their apps. Others, aiming to reuse as much code as possible without compromising app quality, share all application logic across mobile, desktop, web, and TV while maintaining native UIs.

With KMP being widely used in production since its Alpha release, JetBrains has been able to gather extensive feedback and refine the technology to provide a better multiplatform development experience in the Stable version, including the following.

Strict compatibility guarantees

The core of the Kotlin Multiplatform technology consists of many parts, such as compiler support, language features, the libraries API, IDEs, build tooling, and more. All of these cover the most popular code-sharing use-cases and are stable in Kotlin 1.9.20. “Stable” means that we will evolve those parts following strict compatibility rules, so you can confidently use them in your code.

Going beyond the core, KMP also has some more advanced parts that we’re still continuing to work on. Expect/actual classes are an example of such functionality (not to be confused with expect/actual functions, which are fully stable in Kotlin 1.9.20). Such features are explicitly marked as non-stable, and Kotlin will inform you when you’re using them. Please pay attention to the experimentality warnings and the corresponding documentation to make an informed decision about using or not using such features in your projects.

Better build setup user experience

To simplify project setup and maintenance, we’ve introduced the default hierarchy template. This new feature of the Kotlin Gradle plugin automatically configures Kotlin Source Sets for popular scenarios and reduces the amount of boilerplate in typical build scripts.

To help you diagnose build misconfigurations and errors, KMP delivers a couple of improvements in Stable:

  • Approximately 50 diagnostics were added to the Kotlin Gradle plugin, helping to detect common build issues and providing quick tips on how to fix them.
  • Improved output for Gradle errors in Xcode makes build issues in native parts of your project more discoverable.

Build and runtime performance improvements

In addition to other stability and robustness improvements, we’re continuing to improve the performance of KMP:

Thanks to all of these advancements, Kotlin Multiplatform can be used without hesitation for sharing code in production across Android, iOS, desktop (JVM), server-Side (JVM), and web, even in the most conservative usage scenarios.

Get Started

Use the power of the growing Kotlin Multiplatform ecosystem

The evolution of Kotlin Multiplatform isn’t limited to the technology itself, but extends to its thriving ecosystem cultivated by thousands of Kotlin developers worldwide. Since Beta, the number of KMP libraries has multiplied, offering diverse tools for networking, data storage, arithmetics, analytics, and more, enabling swift and confident app development.

The Android team at Google is continuing to support KMP users by providing the experimental multiplatform versions of Jetpack libraries, and they’ve already made the Collections, DataStore, Annotations, and Paging libraries compatible with Kotlin Multiplatform.

The KMP ecosystem also offers a range of tools for the iOS developer experience, with SKIE by Touchlab standing out. It generates Swift code that provides a Swift-friendly API layer, which bridges important Kotlin types, and implements seamless Coroutines interoperability.

Get even more code-sharing freedom with Compose Multiplatform

Compose Multiplatform, a modern declarative cross-platform UI framework by JetBrains, is a significant part of the ever-expanding KMP ecosystem. With Compose Multiplatform, you now have full code-sharing flexibility. Share just one piece of logic, all application logic, or both the logic and the UI, depending on your project’s and team’s requirements:

Compose Multiplatform for Android and desktop (JVM) is already Stable, while support for iOS is currently in Alpha and support for web (Wasm) is Experimental.

Explore the future of Kotlin Multiplatform

JetBrains continues to enhance multiplatform development with Kotlin, aiming to make it the ultimate choice for sharing code across platforms:

  • Future updates for the core Kotlin Multiplatform technology will improve the iOS developer experience, including direct Kotlin-to-Swift interoperability and SwiftPM support.
  • The next milestone for Compose Multiplatform for iOS is Beta support in 2024.
  • JetBrains is actively developing Kotlin/Wasm to facilitate modern web development with KMP, aiming to deliver the Alpha version of Compose Multiplatform for Web (Wasm) next year.

And that’s not all. In the upcoming weeks, get ready for some thrilling announcements regarding the evolution of Kotlin Multiplatform tooling!

Get started with Kotlin Multiplatform

Begin your journey with our extensive, user-friendly educational resources.

Participate in our Kotlin Multiplatform Webinar November Series to get insights directly from JetBrains experts! Explore Kotlin Multiplatform features, build KMP apps with both native and shared UIs, and uncover iOS development tips and tricks:

Register

The new Kotlin Multiplatform Development Portal offers detailed documentation, getting-started guides, and step-by-step tutorials covering all aspects of building apps with Kotlin Multiplatform and Compose Multiplatform:

Get Started

If your team needs help getting started with a multiplatform approach, check out our guide entitled “How to introduce multiplatform development to your team”.

image description