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 theext.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.
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
Scale Fit Mobile Web Content Using Viewport Meta Tag
Android: Looking for a Drawarc() Method with Inner & Outer Radius
Find the Key Hash for a Signed App
Android:How to Upload .Mp3 File to Http Server
How to Remove the Title Text from the Android Actionbar
How to Handle Oncontextitemselected in a Multi Fragment Activity
How to Run (Not Only Install) an Android Application Using .Apk File
Background Service Getting Killed in Android
Android: Why Must Use Getbasecontext() Instead of This
Android Cursor with Ormlite to Use in Cursoradapter
How to Show Popupwindow at Special Location
How to Read Properties Defined in Local.Properties in Build.Gradle
Implicit "Submit" After Hitting Done on the Keyboard at the Last Edittext
How to Programmatically Log Out from Facebook Sdk 3.0 Without Using Facebook Login/Logout Button
Android: How Handle Message Error from the Server Using Volley
Want to Compile Native Android Binary I Can Run in Terminal on the Phone