I'm new to the use of Proguard and Dagger for Android apps, so I would really appreciate if someone could give me a few pointers.
Proguard and Dagger have been implemented into the application. When the app is installed through debug mode (ie, pushed from Eclipse) there are no problems with running the app. However, when I run the release build of the app, it crashes with the following trace:
No injectable members on com.example.test.d. Do you want to add an injectable constructor? required by com.example.test.d com.example.test.SampleActivity.a
No injectable members on com.b.a.b. Do you want to add an injectable constructor? required by com.b.a.b com.example.test.SampleActivity.b
at dagger.internal.h.a(ThrowingErrorHandler.java:34)
at dagger.internal.Linker.a(Linker.java:136)
at dagger.d.a(ObjectGraph.java:264)
at dagger.d.a(ObjectGraph.java:238)
at com.example.test.SampleApplication.a(SampleApplication.java:24)
I have followed the suggestions from: https://plus.google.com/108620120050432268974/posts/AAjvwg3Hmgg, by implementing the following into the proguard-project.txt:
-keep class * extends dagger.internal.Binding
-keep class * extends dagger.internal.ModuleAdapter
-keep class * extends dagger.internal.StaticInjection
but it doesn't seem to fix the issue. Suggestions? Thanks in advance.
Proguard and dagger (pre)-compilation do not seem to work well together in release builds. See https://plus.google.com/117210567825404150882/posts/HGjnJJHbfMj
The "problem" is that the non-obfuscated package names will be compiled into the classes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With