You have no way but to write hilt dependencies (including kapt annotation processor) in all build.Gradle files of your modules.
Just put these dependencies into your module's build.Gradle.
api "com.google.dagger:hilt-android:2.28.1"
kapt "com.google.dagger:hilt-android-compiler:2.28.1"
api "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha02"
api "androidx.hilt:hilt-compiler:1.0.0-alpha02"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…