Skip to content

Commit 9e984e5

Browse files
committed
Fix Hilt error by forcing kotlin-metadata-jvm version to match kotlin version
``` [Hilt] Provided Metadata instance has version 2.3.0, while maximum supported version is 2.2.0. To support newer versions, update the kotlin-metadata-jvm library.: java.lang.IllegalArgumentException: Provided Metadata instance has version 2.3.0, while maximum supported version is 2.2.0. To support newer versions, update the kotlin-metadata-jvm library. ```
1 parent ad260fe commit 9e984e5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

build-logic/convention/src/main/kotlin/HiltConventionPlugin.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class HiltConventionPlugin : Plugin<Project> {
2828

2929
dependencies {
3030
"ksp"(libs.findLibrary("hilt.compiler").get())
31+
"ksp"(libs.findLibrary("kotlin.metadata").get())
3132
}
3233

3334
// Add support for Jvm Module, base on org.jetbrains.kotlin.jvm

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ hilt-ext-compiler = { group = "androidx.hilt", name = "hilt-compiler", version.r
135135
hilt-ext-work = { group = "androidx.hilt", name = "hilt-work", version.ref = "hiltExt" }
136136
javax-inject = { module = "javax.inject:javax.inject", version = "1" }
137137
junit = { module = "junit:junit", version.ref = "junit4" }
138+
kotlin-metadata = { module = "org.jetbrains.kotlin:kotlin-metadata-jvm", version.ref = "kotlin" }
138139
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin" }
139140
kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlin" }
140141
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" }

0 commit comments

Comments
 (0)