Home > database >  Unsupported metadata version. Check that your Kotlin version is >= 1.0: java.lang.IllegalStateExc
Unsupported metadata version. Check that your Kotlin version is >= 1.0: java.lang.IllegalStateExc

Time:06-27

I changed my Kotlin version from 1.6.10 to 1.7.0.

from this

 implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10'

upgrated to

 implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.0'

But Hilt throws an error. My Hilt version is 2.42. Is there a way to fix this without downgrading again? It works fine in Kotlin 1.6.10 and Hilt 2.42. But I want to use it by upgrading my kotlin version.

enter image description here

CodePudding user response:

You may change your kotlin gradle plugin to the same version:
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0"

Here's my components version and it works:

hilt/hilt gradle plugin:2.42
dagger2:2.35.1
kotlin/kotlin gradle plugin:1.6.21

CodePudding user response:

it is saying that u have different verisons of plugin and dependencies

In your project level build.gradle file or Settings.gradle file check for kotlin version you haven't updated it while u have updated your dependency, just change the kotlin version to 1.7.0

  • Related