Home > Software engineering >  Could not find androidx.compose.compiler:compiler:1.2.1
Could not find androidx.compose.compiler:compiler:1.2.1

Time:09-01

Getting the following error when creating a new Compose Project in Android Studio and updating to the suggested compose version of 1.2.1:

Execution failed for task ':app:compileDebugKotlin'.

Could not resolve all files for configuration ':app:kotlin-extension'. Could not find androidx.compose.compiler:compiler:1.2.1. Searched in the following locations: - enter image description here

You can in any case use the stable version of the module compiler 1.3.0 and all the other compose dependencies at 1.2.1:

buildscript {
    ext {
        compose_compiler = '1.3.0'
        compose_version = '1.2.1'
    }
    //...
}

and then:

composeOptions {
    kotlinCompilerExtensionVersion compose_compiler
}

dependencies {
   // stable 1.2.1 releases
   implementation "androidx.compose.material:material:$compose_version"
   //... 
}

As described in the documentation the compiler 1.3.0 requires kotlin 1.7.10:

  • Related