Independent version of Jetpack Compose libraries

Independent version of Jetpack Compose libraries

Posted by Jolanda VerhoefAndroid Developer Relationship Engineer

From today, the different Jetpack Compose libraries will move to independent rendering schemes. This creates the possibility for subgroups such as androidx.compose.compiler or androidx.compose.animation to follow their own release cycles.

Allowing these libraries to run independently will to disconnect dependencies previously implicitly linked, making it easier to incrementally upgrade your application and keep up to date with the latest Compose features.

The first library to break away from the single Compose version is the Compose Compiler. Today we release the 1.2.0 stable version that brings support for Kotlin 1.7.0! The release is both backwards and forwards compatible with the Compose UI Libraries and the Compose Runtime Library. This means that you can upgrade your Compose Compiler to 1.2.0 stable and use Kotlin 1.7.0, while leaving your other Compose libraries on their current version, for example 1.1.0 stable.

To upgrade the version of the Compose Compiler in your application, specify the kotlinCompilerExtensionVersion in you bou.gradle file.

android {
    composeOptions {
        kotlinCompilerExtensionVersion = "1.2.0"
    }
}

Compose and Kotlin are highly linked, and we heard your feedback that Compose compiler updates are needed to enable you to upgrade your Kotlin version. We want to make sure that you can use the latest and greatest features (and bug fixes) of both Compose and Kotlin, which is why we plan to release stable versions of the Compose Compiler on a much more regular basis. This means that Compose Compiler version numbers will progress at a faster rate than most other Compose libraries. Since the Compose Compiler is both forward and backward compatible, you will be able to upgrade it as soon as a new version is released.

The Compose Compiler is built as a Kotlin Compiler Plugin, so you need to use a version of the Compose Compiler that is compatible with the version of Kotlin you have chosen. To help you choose the version that suits your project, check out the Compose-Kotlin Compatibility Map.

Moving the compiler library to another version scheme is the first step in disconnecting versions for the different Compose library groups. You will see new stable releases for the other Compose libraries in the next few weeks, and then they will start following their own release cycles, independent of the Compose Compiler.

Prepare your build for individual version and start using the latest Compose Compiler and Kotlin versions now!

We look forward to seeing what you build with Compose!