-
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
Incremental build failures with 2.25.2 (new Kotlin qualifier annotations) #1659
Comments
Thanks for reporting this! We are aware of some cases where Dagger is still unable to find the qualifier annotation, meaning you have to fallback to I was able to reproduce the issue in a small project with two gradle modules. App and Lib. Where Lib has the Kotlin class being member injected and App is where Dagger is setup with We are still working on a fix but at the same time I filled a bug towards |
@danysantiago Thanks! In my case the Kotlin injection target is in the same gradle module as the Dagger setup.
Would this also apply in the case of incremental compilation in the same gradle module, i.e. if my Kotlin injection target class has already been compiled in a previous build? |
Yes - It might be possible that this is also observed during incremental builds. |
@GrahamBorland why not switching from Example:
Not as a workaround but as an improvement. |
@GuilhE This issue reproducible and for
It's improvement only if you do not use this dependency between modules, sometimes you just cannot access annotation without creating a separate module for it which is overkill in many cases |
@gildor thanks for sharing this knowledge, never had to use |
I just noticed this where we are running kapt on a library -> app module style setup. |
Having qualifiers in the generated MemberInjectors helps the root downstream processor read Kotlin property annotations that are lost across compilations due to https://youtrack.jetbrains.com/issue/KT-34684 When Dagger is applied to all subprojects with @Inject fields or constructors then this change fixes #1659. RELNOTES=Workaround missing Kotlin qualifiers annotations across compilation units by propagating qualifiers along with MemberInjectors when Dagger processor is applied to upstream projects. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=283574407
Having qualifiers in the generated MemberInjectors helps the root downstream processor read Kotlin property annotations that are lost across compilations due to https://youtrack.jetbrains.com/issue/KT-34684 When Dagger is applied to all subprojects with @Inject fields or constructors then this change fixes #1659. RELNOTES=Workaround missing Kotlin qualifiers annotations across compilation units by propagating qualifiers along with MemberInjectors when Dagger processor is applied to upstream projects. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=283574407
*** Reason for rollback *** Caused b/145946461 *** Original change description *** Propagate qualifiers for field injections in MemberInjectors. Having qualifiers in the generated MemberInjectors helps the root downstream processor read Kotlin property annotations that are lost across compilations due to https://youtrack.jetbrains.com/issue/KT-34684 When Dagger is applied to all subprojects with @Inject fields or constructors then this change fixes #1659. *** ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=284670569
*** Reason for rollback *** Caused b/145946461 *** Original change description *** Propagate qualifiers for field injections in MemberInjectors. Having qualifiers in the generated MemberInjectors helps the root downstream processor read Kotlin property annotations that are lost across compilations due to https://youtrack.jetbrains.com/issue/KT-34684 When Dagger is applied to all subprojects with @Inject fields or constructors then this change fixes #1659. *** ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=284670569
Seeing this frequently with incremental builds since updating to 2.25.2. Works fine on a clean build.
Here's the relevant parts of the component (Java):
The error only happens since updating Dagger to 2.25.2 and changing the injection site to benefit from the new Kotlin support.
BEFORE - always worked fine
AFTER updating to 2.25.2 - regular incremental build failures
If I have misunderstood what's supposed to be possible with 646e033 then I look forward to being educated. :)
Dagger 2.25.2
Kotlin 1.3.50
Android Gradle Plugin 3.5.1
The text was updated successfully, but these errors were encountered: