I want to add dagger-hilt plugin to project.
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.40.5'
https://developer.android.com/studio/preview/features#settings-gradle
plugins {
id 'com.android.application' version '7.1.0-beta02' apply false
id 'com.android.library' version '7.1.0-beta02' apply false
id 'org.jetbrains.kotlin.android' version '1.5.30' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = 'GradleManagedDeviceTestingNew'
include ':app'
4
Answers
You should add a resolutionStrategy to settings.gradle as below.
Then, add the hilt plugin as below to the module level build.gradle file, it was updated correctly.
When creating a new project in AS BubmleBee the dependencies block is missing in top-level gradle file
To resolve adding classpath dependencies you should add the following block within the buildscript block.
This is the correct to using the classpath in bumblebee
Use buildscript before plugins it will work and put your classpath there in the dependencies block
Add the following id in the plugins section of the top level gradle file:
Credits to this SO answer