FIx Issue - Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1

568 views Asked by At

Its not being build in my system, all the related versions - like kotlin gradle plugin version, android gradle plugin version, gradle version - all are same shared on github with the team, and its only happening in my system.

WHat could be the reason?

  ext.kotlin_version = '1.8.21'

    ext.gradlePluginVersion = '8.0.2'

classpath "com.android.tools.build:gradle:$gradlePluginVersion"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

Gradle properties :

distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
1

There are 1 answers

0
Vodet On

This is because your kotlin version is

 ext.kotlin_version = '1.8.21'

But the module want a 1.7.1 version

You have two options, you can downgrade to 1.7.1 or try to update the module version, maybe he handle 1.8.21

But if you use compose look to : https://developer.android.com/jetpack/androidx/releases/compose-kotlin?hl=fr

You see

compose 1.4.3   kotlin 1.8.10

You can't use a kotlin version higher than 1.8.10 if you would like to use compose.

You certainly have the same problem with your module.