. Advertisement .
..3..
. Advertisement .
..4..
If you are trying to run your application in Android Studio and you keep on getting the error message ‘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′, then you are at the right place. In this blog, we will share a few tips on how to solve this annoying error.
What is “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”?
When running your project, you may receive the message “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”. This is an example:
caches/transforms-2/files-2.1/4541b0189187e0017d23bbb0afebd16a/jetified-kotlin-stdlib-
common-1.5.0.jar!/META-INF/kotlin-stdlib-common.kotlin_module: 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.
What causes error?
If you are getting this error, this is most likely what is causing it:
- version locking mechanism (kotlin or gradle) is broken
- The version in use is old, not upgraded yet
How to deal with it?
We have compiled some solutions to handle the above error. You can consult and choose the method that suits you to be able to solve it quickly.
Option 1
This error is caused by the fact that you are using an old Kotlin version.
Simply modify this at build.gradle
from
ext.kotlin_version = '1.3.50'
to
ext.kotlin_version = '1.4.32'
or whatever the most recent version of Kotlin.
Next, just upgrade the Kotlin version in Android Studio.
Option 2
Check that your IDE’s Kotlin version matches the version defined in the gradle.build file. Check by going to File > Settings > Plugins, then check the kotlin version in the IDE and replace the value in ext.kotlin_version:
ext.kotlin_version = '1.6.10'
Option 3
Simply update your Kotlin version from 1.3.61 to 1.5.10.
......... ADVERTISEMENT .........
..8..

Option 4:
Also, double check your program already has this line, if not, add it:
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Here is full code:
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Conclusion
We hope you enjoyed our article about this error. With this knowledge, we know that you can fix your “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” error quickly by following these steps! If you still have any other questions about fixing this syntax error, please leave a comment below. Thank you for reading!
Leave a comment