Unsupported Metadata Version: Hilt Dependency Error
Photo Credit by medium.com/@alik.rafi7
I encountered this error while I was working with hilt dependencies in my Android project
error: [Hilt]
91 Unsupported metadata version. Check that your Kotlin version is >= 1.0: java.lang.IllegalStateException: Unsupported metadata version. Check that your Kotlin version is >= 1.0
I initially added the following Hilt dependencies in my gradle file
build.gradle (App Level)
//plugins
kotlin("kapt")
id("com.google.dagger.hilt.android")
//Dagger-Hilt dependencies
implementation("com.google.dagger:hilt-android:2.44")
kapt("com.google.dagger:hilt-android-compiler:2.44")
build.gradle.kts(Project Level)
id("com.google.dagger.hilt.android") version "2.44" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
How I fixed the error
Fixing this error is very easy to do, although I debugged for hours before I realized that it was just to change the hilt dependency version at the App and Project level
Go to: Change the hilt dependency version to the one that is compatible with your Kotlin version
build.gradle (App Level)
//Dagger-Hilt dependencies
implementation("com.google.dagger:hilt-android:2.48")
kapt("com.google.dagger:hilt-android-compiler:2.48")
build.gradle.kts(Project Level)
id("com.google.dagger.hilt.android") version "2.48" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
Subscribe to my newsletter
Read articles from Etugbo Judith directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Etugbo Judith
Etugbo Judith
I'm a Technical writer passionate about breaking down complex concepts into clear, concise and engaging content.