dagger: Hilt: Compiler processor doesn't recognize options dagger.fastInit, dagger.hilt.android.internal.disableAndroidSuperclassValidation
Hello.
I am developing multi-module Android project with Hilt version 2.28.3-alpha. I have included dagger compiler to every module which requests or provides. After compilation in Android studio 4.0.1 I see warnings in every module:
warning: The following options were not recognized
by any processor: '[dagger.fastInit, dagger.hilt.android.internal.disableAndroidSuperclassValidation, kapt.kotlin.generated]'
Though these are warnings I was taught to pay attention to them as well, since they might indicate a potential problem with logic or performance, or anything else.
Applications seems to compile and run successfully, but are these warnings important? May be I am missing some Dagger Hilt setting?
Thank you.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 21
- Comments: 15 (2 by maintainers)
Commits related to this issue
- Prevent KAPT from logging errors when compiling modules without entry points When Hilt Android is run on a module that contains no entry points, KAPT will log an error about disableAndroidSuperclassV... — committed to ansman/dagger by ansman 3 years ago
- Prevent KAPT from logging errors when compiling modules without entry points When Hilt Android is run on a module that contains no entry points, KAPT will log an error about disableAndroidSuperclassV... — committed to ansman/dagger by ansman 3 years ago
- Prevent KAPT from logging errors when compiling modules without entry points When Hilt Android is run on a module that contains no entry points, KAPT will log an error about disableAndroidSuperclassV... — committed to ansman/dagger by ansman 3 years ago
- Prevent KAPT from logging errors when compiling modules without entry points. When Hilt Android is run on a module that contains no entry points, KAPT will log an error about `disableAndroidSuperclas... — committed to google/dagger by danysantiago 3 years ago
- Prevent KAPT from logging errors when compiling modules without entry points. When Hilt Android is run on a module that contains no entry points, KAPT will log an error about `disableAndroidSuperclas... — committed to google/dagger by danysantiago 3 years ago
- Prevent KAPT from logging errors when compiling modules without entry points. When Hilt Android is run on a module that contains no entry points, KAPT will log an error about `disableAndroidSuperclas... — committed to google/dagger by ansman 3 years ago
I had same problem. added: id ‘com.google.dagger.hilt.android’ to build gradle and it works
Could it be that a module that reports this doesn’t use some of the Hilt features? Maybe the module that reports this doesn’t use any
@AndroidEntryPoint? Just guessing, I haven’t checked that assumption at all.Thanks for the repro @jt-9!
Unfortunately, I don’t think there’s much we can do on our end about it. This appears to be a
kaptissue (note: it doesn’t happen withannotationProcessor).It seems
kaptignoresProcessor#getSupportedOptions()if none of theProcessor#getSupportedAnnotationsTypes()are found in the sources.In your case,
component_dbuses Dagger but not Hilt annotations in the sources, which is why the Dagger optiondagger.fastInitdoesn’t show up as unrecognized in that case. However, forbase_uiyou don’t use Dagger or Hilt annotations in the sources, which is why all of the options show up as unrecognized.Solution
There’s a couple options here:
Hi @bcorso, sorry for late response. Here is reproducible example app https://github.com/jt-9/HiltMultiModuleMRP, if you build it with command
./gradlew clean assembleReleaseoutput should be similar toAs for other warning with
'[dagger.fastInit, kapt.kotlin.generated]'still working on that.@lukas1 Thanks for sharing an idea, will try it.
@jt-9 Did you ever end up filing an issue on the Kotlin issue tracker?
For me adding this to the build file (in the android block) fixed it:
reference: https://youtrack.jetbrains.com/issue/KT-46940/Kapt-reports-a-warning-The-following-options-were-not-recognized-by-any-processor…#focus=Comments-27-5211169.0-0
I’m going to close this since there doesn’t seem to be much we can do about this warning from our side.
@bcorso I updated the repository with app that reproduces warnings https://github.com/jt-9/HiltMultiModuleMRP
Thanks to @lukas1 point I added module
base_uiwhich containsBaseViewModelActivitybut doesn’t use any Dagger Hilt feature, but it still includes compiler as a part of common includeconfig.gradlewhich results in warningHi @jt-9, I wasn’t able to reproduce this. Do you have a minimal reproducible example app that you could share that demonstrates the behavior?