best practices for Dagger Hilt Injection Issues in a Multi-Module Android Project with Android 14?
I'm maintaining legacy code that Hey everyone, I'm running into an issue that's driving me crazy... I'm working with an scenario with Dagger Hilt injection in my multi-module Android project after migrating to Android 14. I've noticed that some of my dependencies are not being correctly injected, leading to a `javax.inject.Inject` behavior stating that the object want to be provided. Specifically, a dependency in my feature module is supposed to be injected into an Activity, but I'm getting the following behavior: ``` java.lang.IllegalStateException: Entry point 'MyActivityEntryPoint' does not have a required dependency 'MyDependency'. ``` I have the following structure in my project: - `app` module (base application) - `feature` module (contains the Activity and the dependency) - `core` module (contains shared utilities and interfaces) In my `app` module, I set up Hilt like this: ```kotlin @HiltAndroidApp class MyApplication : Application() ``` In the `feature` module, I have: ```kotlin @AndroidEntryPoint class MyActivity : AppCompatActivity() { @Inject lateinit var myDependency: MyDependency override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_my) } } ``` And my `MyDependency` is defined like this in the `core` module: ```kotlin @Module @InstallIn(SingletonComponent::class) object CoreModule { @Provides @Singleton fun provideMyDependency(): MyDependency { return MyDependency() } } ``` I've ensured that all modules are correctly included in the `build.gradle` files and that Hilt is set up properly with the necessary dependencies. I've tried cleaning the project, invalidating caches, and rebuilding, but the behavior continues. Does anyone know what might be causing this injection scenario in a multi-module setup, or if there are any additional steps I should take to correctly configure Hilt for this architecture? I'm open to any suggestions. This issue appeared after updating to Kotlin 3.9. I'd really appreciate any guidance on this. This is for a CLI tool running on Debian. Any advice would be much appreciated.