"Module Was Compiled with an Incompatible Version of Kotlin. the Binary Version of Its Metadata Is 1.5.1, Expected Version Is 1.1.16"

Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.16

For someone who is still looking for answer to this, here is the working solution for this problem. In your project level open build.gradle file, increase the
ext.kotlin_version from whatever current version that you have like 1.5.0, to the latest stable version 1.6.0 (Whatever is latest at that time). Thanks

You can get latest version from here:

https://kotlinlang.org/docs/releases.html#release-details

Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15

Changing this in file build.gradle solved my problem.

From

ext.kotlin_version = '1.3.50'

to

ext.kotlin_version = '1.6.0'

Or whatever the latest version of Kotlin available and make sure to update Kotlin version on Android Studio as well.

Kotlin module problem that turns into java noClassDefFoundError

These are the two Stack Overflow posts that led me to my answer (1, 2).

You need to update your Gradle settings. I updated mine to Gradle version 6.1.1 using the chart in the answer to the first SO post I referenced.

The second thing you need to do is specify sourceCompatibility and targetCompatibility as JavaVersion.VERSION_1_8 in the compileOptions section of the app level Gradle file.

Room and Jetpack Compose may cause this error, Module was compiled with an incompatible version of Kotlin.

You can try upgrading kotlin to 1.7.10 and compose to 1.3.0.
If not worked,try with compose 1.2.0 and kotlin 1.7.0
You can find all compataible versions here.

Sample Image

Also make sure to use same variable for kotlin gradle plugin in project build.gradle.

   classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"


Related Topics



Leave a reply



Submit