-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hilt: Compile error on attempt to inject @ActivityContext as member property #1980
Comments
I think this might be occurring because |
@danysantiago Thank you, for quick reply.
And
Indeed the Dagger Hilt ver |
If the qualifiers does not have the target field then it can't be used with in members that are injected either by entry points or @androidentrypoint. This change also removes the @target(TYPE) the annotation contained, this was a mistake and there is no reason for this qualifier to be added to a class definition. Fixes #1980 RELNOTES=Added missing FIELD target to @ActivityContext qualifier. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=320698031
If the qualifiers does not have the target field then it can't be used with in members that are injected either by entry points or @androidentrypoint. This change also removes the @target(TYPE) the annotation contained, this was a mistake and there is no reason for this qualifier to be added to a class definition. Fixes #1980 RELNOTES=Added missing FIELD target to @ActivityContext qualifier. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=320698031
I am setting Hilt as DI tool in my Kotlin Android project. The issue appears when I try to inject activity context and with qualifier standard
@ActivityContext
. Compile error message:This annotation is not applicable to target 'member property with backing field'
Code sample
If I annotate property with qualifier
@ApplicationContext
Hilt properly injects itDagger Hilt ver
2.28.1-alpha
The text was updated successfully, but these errors were encountered: