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"
CodePudding user response:
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.
CodePudding user response:
Currently the latest version of compose.compiler is 1.2.0
.
To use 1.3.0-alpha01
of available modules you could use:
buildscript {
ext {
compose_version = '1.2.0-rc02'
compose_alpha = '1.3.0-alpha01'
}
//...
}
And then:
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
dependencies {
implementation "androidx.compose.ui:ui:$compose_alpha"
implementation "androidx.compose.material:material:$compose_alpha"
}