I'm trying to include dagger hilt to my multimodule project with just three modules (app, frameworks_and_drivers, interface_adapters). I followed the hilt documentation https://developer.android.com/training/dependency-injection/hilt-android?hl=es-419, so i ended addding the same things to the three different modules, i know we can sinplify to just add in a single one. When i tried to rebuild the project this error appear: "error: cannot find symbol import dagger.hilt.android.components.ApplicationComponent;"
for some reason the ApplicationComponent is not available even when the other are.
Maybe if one of you know how to fix this, please let me know. Thanks!
from 2.33-beta
there is no ApplicationComponent, you will have to use SingletonComponent. docs is here.
I found a workaround updating the hilt version in build.gradle (Project) classpath 'com.google.dagger:hilt-android-gradle-plugin:2.31.2-alpha'
and updating also the dependencies on build.gralde (your_module) **"
// DI with Hilt
implementation "com.google.dagger:hilt-android:2.31.2-alpha"
kapt "com.google.dagger:hilt-compiler:2.31.2-alpha"
implementation 'androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03
'"** This is the video that helped to me with this: https://youtu.be/9ZnzmbClarw
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With