Closed crescent7272 closed 1 year ago
"Application class annotated with @HiltAndroidApp has to be defined in an android application project"
This means that your @HiltAndroidApp
annotated class is currently defined in a library module (i.e. a build.gradle file with plugins { id 'com.android.library' }
, which is not allowed. Instead, you need to move that class into the application module (i.e. a build.gradle file with plugins {id 'com.android.application'}
.
I am trying to implement multi module hilt project. However I am having trouble to make it work. I got this error and googled but I could not find any result.
Here is the error I get:
This is my application class.
This is my top level build.gradle file // Top-level build file where you can add configuration options common to all sub-projects/modules.
And the following is app/build.gradle (which is library)
And the following is dev/build.gradle (which is a module I created)
This is my manifest of the main module
This is my manifest of the module dev
Following is settings.gradle
I have no idea why I could not manage a create a multi module Hilt project. I must have doing something wrong. I searched but there is no result in google. This is my post at stackoverflow => https://stackoverflow.com/questions/74534344/the-compiler-option-dagger-hilt-android-internal-projecttype-is-not-a-recogniz
Thanks in advance.