I am using Jetpack Compose in my Android app. The Gradle build works fine without any exceptions but when i build the project, it throws this error
I've tried upgrading & downgrading my dependency versions. These are my Gradle dependencies.
[versions]
agp = "8.4.2"
kotlin = "1.9.10"
coreKtx = "1.13.1"
junit = "4.13.2"
junitVersion = "1.2.1"
espressoCore = "3.6.1"
lifecycleRuntimeKtx = "2.8.4"
activityCompose = "1.9.1"
androidxHilt = "1.2.0"
coil = "2.7.0"
hiltVersion = "2.50"
retrofit = "2.9.0"
okhttp = "4.12.0"
ksp = "1.9.22-1.0.17"
mlkitBarcode = "17.3.0"
mlkitBarcodeDynamic = "18.3.1"
composeBom = "2024.06.00"
composeNavigation = "2.8.0-beta07"
serialization = "1.6.3"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-hilt = { group= "androidx.hilt", name= "hilt-navigation-compose", version.ref = "androidxHilt"}
coil-kt = { group= "io.coil-kt", name= "coil-compose", version.ref = "coil"}
google-dagger = { group= "com.google.dagger", name= "hilt-android", version.ref = "hiltVersion"}
retrofit = { group= "com.squareup.retrofit2", name= "retrofit", version.ref = "retrofit"}
converter-moshi = { group="com.squareup.retrofit2", name="converter-moshi", version.ref = "retrofit"}
okhttp = { group="com.squareup.okhttp3", name= "okhttp", version.ref = "okhttp"}
okhttp-interceptor = {group= "com.squareup.okhttp3", name= "logging-interceptor", version.ref = "okhttp"}
ksp-dagger = {group= "com.google.dagger", name= "hilt-compiler", version.ref = "hiltVersion"}
mlkit-barcode-scanner = { group = "com.google.mlkit", name = "barcode-scanning", version.ref= "mlkitBarcode"}
mlkit-barcode-scanner-dynamic = { group= "com.google.android.gms", name= "play-services-mlkit-barcode-scanning", version.ref= "mlkitBarcodeDynamic"}
navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "composeNavigation" }
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization"}
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
google-devtools-ksp = { id= "com.google.devtools.ksp", version.ref = "ksp"}
hilt = {id = "com.google.dagger.hilt.android", version.ref = "hiltVersion"}
You should use the corresponding version of KSP with the Kotlin plugin in the project.
ksp = "1.9.22-1.0.17"
kotlin = "1.9.10"