Skip to content

Instantly share code, notes, and snippets.

@eduardobape
Last active May 5, 2022 14:59
Show Gist options
  • Save eduardobape/fdec9c6636b7b9f1004167dd91e975c7 to your computer and use it in GitHub Desktop.
Save eduardobape/fdec9c6636b7b9f1004167dd91e975c7 to your computer and use it in GitHub Desktop.
How to add gradle plugins and dependencies to include dagger-hilt to an Android project using Android Studio BumBlebee 2021.1.1 version or higher

File build.gradle (project):

buildscript {
    ext {
        daggerHiltVersion = '2.41'
    }
}
plugins {
    id 'com.google.dagger.hilt.android' version "$daggerHiltVersion" apply false
}

File build.gradle (app):

plugins {
    id 'kotlin-kapt'
    id 'dagger.hilt.android.plugin'
}
...
dependencies {
    implementation "com.google.dagger:hilt-android:$daggerHiltVersion"
    kapt "com.google.dagger:hilt-compiler:$daggerHiltVersion"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment