Dagger not generating Proguard/R8 rules with option experimentalUseStringKeys
See original GitHub issueI’m having some issues with experimentalUseStringKeys
on Android Studio 3.4 (beta 3). When running the app (release build with R8) it throws the following exception:
java.lang.IllegalArgumentException: No injector factory bound for Class<Alb>
When adding the following to my Proguard rules manually the exception does not occur anymore:
-identifiernamestring class dagger.android.internal.AndroidInjectionKeys {
java.lang.String of(java.lang.String);
}
So it looks like that for some reason this isn’t added automatically by Dagger, which is strange as I verified that a generated APK used R8 version 1.4.29. This should have support for generated proguard rules.
Android Studio version: 3.4 beta 3 (same issue in 3.3 stable) Dagger version: 2.21
EDIT: Fixed Android Studio version
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top Results From Across the Web
Dagger 2 does not generate component - Stack Overflow
In build 171.4073.35 Delegate IDE build/run actions to gradle option is set by ... in their gradle file to let intellij recognize dagger...
Read more >Using Dagger in Android apps
The Dagger basics page explained how Dagger can help you automate dependency injection in your app. With Dagger, you don't have to write ......
Read more >Deep dive into Dagger generated code (part 1) - ProAndroidDev
In this blog post, we will convert the Dagger generated code from Java to Kotlin to understand how @Inject constructors and @Provides works....
Read more >Dagger - Square Open Source
Use @Inject to annotate the constructor that Dagger should use to create ... Classes that lack @Inject annotations cannot be constructed by Dagger....
Read more >Using Dagger 2 for dependency injection in Android - Tutorial
@Component : enable selected modules and used for performing dependency injection. Dagger 2 uses generated code to access the fields and not reflection....
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
I opened a bug on R8 here. Let’s converge on that, and we can reopen if that ends up not being the case.
Maybe a bug in the toolchain only assuming it needs to carry class files as outputs?
On Thu, Feb 7, 2019 at 4:55 PM Ron Shapiro notifications@github.com wrote: