Dagger generates code with wrong parameter names for member injection
See original GitHub issueThis issue is very similar to #3401. The bug for subcomponents is resolved, but there’s still an issue with member injection. The generated code for member injection looks like this:
@Override
public void inject(Abc abc) {
injectAbc(arg0);
}
I’ve updated the sample here: https://github.com/vRallev/anvil/tree/ralf/dagger-bug Notice that the branch is ralf/dagger-bug
. You should be able to reproduce the bug by running ./gradlew test
. This issue happens with Dagger 2.43 and the latest snapshot.
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:5
Top Results From Across the Web
Dagger 2: Injecting user inputted parameter into object
Basically, you create an injectable factory class that takes runtime parameters such as address as arguments to the object creation methods that it...
Read more >Deep dive into Dagger generated code (part 2) - ProAndroidDev
Factory as constructor parameters of the component. Members injection. Sometimes we don't control the lifecycle of an object — we can't ...
Read more >Android - Dagger
Dagger is a fully static, compile-time dependency injection framework for both Java and Android. It is developed by the Java Core Libraries Team...
Read more >Using Dagger 2 for dependency injection in Android - Tutorial
Dagger 2 is dependency injection framework. It is based on the Java Specification Request (JSR) 330. It uses code generation and is based...
Read more >Dependency Injection in Kotlin using Dagger2
The generated code is very relatively easy to read and debug. ... Dagger doesn't support Injection in private fields and the final field....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the repro! I should have a fix out today and we can do a 2.43.1 release next week.
The fix works. Thanks!