I'm facing issue while adding hilt dependencies in my project
plugins
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'realm-android'
id 'androidx.navigation.safeargs.kotlin'
id 'kotlin-parcelize'
}
dependencies
//Dependency injection with Hilt
implementation("com.google.dagger:hilt-android:2.38.1")
kapt("com.google.dagger:hilt-android-compiler:2.38.1")
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
build.gradle project level
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "io.realm:realm-gradle-plugin:10.11.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.42"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
i have tried below answers from stack-overflow but didn't find the solutions
Hilt Unsupported metadata version in Kotlin
Upgrading Android kotlin version to 1.5.0 throwing error message on build
If need more information please do let me know. Thanks in advance. Your efforts will be appreciated.