Problem with updating compose version to 1.3.0-alpha01

Issue

I have an Android Studio project that works fine when I’m using Kotlin version 1.6.21 and compose version 1.2.0-rc01. The problem arises when I want to update both dependencies to the latest versions, which are 1.7.10 for Kotlin and 1.3.0-alpha01 for compose. The error that I get is:

Could not resolve all files for configuration ‘:app:kotlin-extension’.
Could not find androidx.compose.compiler:compiler:1.3.0-alpha01.
Searched in the following locations:

Required by:
project :app

Any help?

Edit:

Now I’m using these versions:

kotlinCompilerExtensionVersion '1.7.10'

implementation "androidx.compose.ui:ui:1.3.0-alpha01"
implementation "androidx.compose.material:material:1.3.0-alpha01"
implementation "androidx.compose.compiler:compiler:1.2.0"

Solution

An alternate Compose compiler version can be defined with composeOptions:

android {
    composeOptions {
        kotlinCompilerExtensionVersion "1.2.0"
    }
}

There’s no need to add it as an implementation, which it definitely isn’t.
runtimeOnly might eventually work, but it won’t make it into the package.

Answered By – Martin Zeitler

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published