18

I'm using Dagger2 android-support library with Proguard but i can't compile my project because of this error :

Warning:dagger.android.AndroidInjector: can't find referenced class com.google.errorprone.annotations.DoNotMock
Warning:dagger.android.AndroidInjector$Builder: can't find referenced class com.google.errorprone.annotations.DoNotMock
Warning:dagger.android.AndroidInjector$Factory: can't find referenced class com.google.errorprone.annotations.DoNotMock
Warning:dagger.android.DaggerApplication: can't find referenced class com.google.errorprone.annotations.ForOverride
Warning:dagger.android.DispatchingAndroidInjector: can't find referenced class com.google.errorprone.annotations.CanIgnoreReturnValue
Warning:there were 5 unresolved references to classes or interfaces.

The version of Dagger that I'm using is 2.11.

The question is what Proguard rules should i use for Dagger2 android-support library ?

Mahdi Nouri
  • 1,391
  • 14
  • 29

1 Answers1

48

Should be:

-keep class com.google.errorprone.annotations.** { *; }

Update: Probably the following rule alone is enough, no need to add previous rule.

-dontwarn com.google.errorprone.annotations.**
Xavier Rubio Jansana
  • 6,388
  • 1
  • 27
  • 50