This is a tracking issue for feedback on the experimental error messages.
When using this option, the format and some content of error messages will be changed in order to improve readability. Pending feedback, this format will eventually become the default and replace current error messages.
To opt-in to the new format use -Adagger.experimentalDaggerErrorMessages=enabled after version 2.27.
Currently, this flag:
We're testing the new error messages.
[Dagger/MissingBinding] FeatureProvider cannot be provided without an @Provides-annotated method.
FeatureProvider is provided at
DevelopmentLoginScreenComponent.featureProvider() [DemoLegacyAppComponent → DemoLegacyLoggedInComponent → DemoLegacyMainActivityComponent]
======================
Full classname legend:
======================
DemoLegacyAppComponent: com.squareup.development.shell.demo.legacy.DemoLegacyAppComponent
DemoLegacyLoggedInComponent: com.squareup.development.shell.demo.legacy.DemoLegacyLoggedInComponent
DemoLegacyMainActivityComponent: com.squareup.development.shell.demo.legacy.DemoLegacyMainActivityComponent
DevelopmentLoginScreenComponent: com.squareup.development.shell.login.screen.DevelopmentLoginScreenComponent
FeatureProvider: com.squareup.development.shell.login.screen.FeatureProvider
While correct the wording is very confusing. It says: FeatureProvider cannot be provided without... and FeatureProvider is provided at on the next line. Maybe change the 2nd line to FeatureProvider is required for / at.
Thanks for the feedback. I had noticed that before but forgot to submit that change. Funnily enough that wording is actually in the existing error messages, but I think it gets lost in the noise. I will likely change that wording to "requested at" or "injected at" which hopefully will make more sense.
I was aware that the confusing wording already exists. But I thought now is a good time to report it since it's more prominent. Both "requested at" and "injected at" make sense. I'd prefer the latter, because usually you "@Inject" something. For components providing dependencies "requested at" would make more sense, but that's not the norm.
Excuse my ignorance, where do we put -Adagger.experimentalDaggerErrorMessages=enabled
@tomislavhofman it depends on your build system. For Gradle I used this
javaCompileOptions {
annotationProcessorOptions {
arguments = [
"dagger.experimentalDaggerErrorMessages" : "enabled"
]
}
}
@tomislavhofman it depends on your build system. For Gradle I used this
javaCompileOptions { annotationProcessorOptions { arguments = [ "dagger.experimentalDaggerErrorMessages" : "enabled" ] } }
in android -> defaultConfig section
or
kapt {
arguments {
arg("dagger.experimentalDaggerErrorMessages", "enabled")
}
}
in android section
Most helpful comment
in android -> defaultConfig section
or
in android section