Skip to content

Instantly share code, notes, and snippets.

@hasanmohdkhan
Created July 22, 2020 07:15
Show Gist options
  • Save hasanmohdkhan/2f1f9e97a05b077b2861b77969969ecf to your computer and use it in GitHub Desktop.
Save hasanmohdkhan/2f1f9e97a05b077b2861b77969969ecf to your computer and use it in GitHub Desktop.
#project level
build.gradle
dependencies {
//...
classpath "com.google.dagger:hilt-android-gradle-plugin:${version_hilt}
//...
}
#Module level
build.gradle
//Plugin required
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
//Hilt uses Java 8 features. To enable Java 8 in your project,
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
//...
implementation "com.google.dagger:hilt-android:$version_hilt"
kapt "com.google.dagger:hilt-android-compiler:$version_hilt"
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment