You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7 KiB

# Development for Android
## What is covered
This tutorial covers topic of using Compose Multiplatform for multiplatform build that includes Android
## Intro
3 years ago
Compose Multiplatform build doesn't contain any Android artifacts.
3 years ago
Instead it references Jetpack Compose Android artifacts [published by Google](https://developer.android.com/jetpack/compose).
3 years ago
This way we ensure that libraries built for Android using Jetpack libraries are compatible with Android Multiplatform.
## Usage
3 years ago
Jetpack Compose interoperability is enabled on the publication level - nothing needs to be explicitly enabled.
3 years ago
3 years ago
The easiest way to start is to use Kotlin Project Wizard with Compose Multiplatform template - one of the target platform is Android.
3 years ago
3 years ago
To see how it could be achieved see the [multiplatform template](https://github.com/JetBrains/compose-jb/tree/master/templates/multiplatform-template).
## Versioning
3 years ago
Compose Multiplatform `1.0.0` references Jetpack Compose `1.1.0-beta02`. If one wants to use a different version, they could explicitly
override Jetpack Compose dependencies to the Android module like this:
3 years ago
```kotlin
configurations.all {
resolutionStrategy {
force("androidx.compose.animation:animation:1.1.0-beta03")
}
}
```
However please note, that Kotlin Compiler version used for Android must match.
3 years ago
## Android Gradle Plugin (AGP) version
3 years ago
For multiplatform Android modules using AGP `4.1.3` with the block like
3 years ago
```kotlin
dependencies {
classpath("com.android.tools.build:gradle:4.1.3")
}
```
is recommended. We're working on providing compatibility with more recent AGP versions, see [KT-49835](https://youtrack.jetbrains.com/issue/KT-49835) and
[KT-49789](https://youtrack.jetbrains.com/issue/KT-49798).