Kotlin Multiplatform (KMP) enables sharing Kotlin code across different platforms. Kotlin Multiplatform is developed by JetBrains, and using KMP to target mobile platforms is stable and production-ready.
Multiplatform Jetpack libraries
We use Kotlin Multiplatform within Google and recommend using KMP for sharing business logic between Android and iOS platforms.
Many of our Jetpack libraries have already been migrated to take advantage of KMP, and these libraries have compatibility guarantees similar to those for their corresponding Android targets.
The following Jetpack libraries provide KMP support:
Maven Group ID | Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release | Documentation |
---|---|---|---|---|---|---|
annotation (*) | August 21, 2024 | 1.8.2 | - | - | 1.9.0-alpha02 | |
collection | August 7, 2024 | 1.4.3 | - | - | - | |
datastore | May 1, 2024 | 1.1.1 | - | - | - | Documentation |
lifecycle (*) | August 7, 2024 | 2.8.4 | - | - | 2.9.0-alpha01 | |
paging (*) | August 7, 2024 | 3.3.2 | - | - | - | |
room | August 21, 2024 | 2.6.1 | - | - | 2.7.0-alpha07 | Documentation |
sqlite | August 21, 2024 | 2.4.0 | - | - | 2.5.0-alpha07 | Documentation |
The reference documentation for these libraries marks the APIs based on their availability for common code, Android, and Native. You can also filter for declarations by platform at the top of each page.
The kotlin-multiplatform-samples GitHub repository showcases some of the functionality of these libraries.
If you have feedback on these libraries, please share it through the issue tracker.
Tooling support
You can open, edit, and run multiplatform projects in Android Studio. However, some IDE features aren't yet available for these projects. To create a new project, use the Kotlin Multiplatform wizard from Jetbrains.
We're also ensuring that the Android Gradle Plugin is compatible with Kotlin Multiplatform by testing core scenarios for new releases.