title: ButterKnife 5.1.1 Proguard Error
body: <p>I am developing an Android application and I am using <code>ButterKnife</code> library in my application. Now I need to proguard and unfortunatly, butterknife generated lot of errors. I tried lot of solutions from internet including the ButterKnife Github itself, but no good.  I am using <code>ButterKnife 5.1.1</code> and below is the error I get.</p>
  
  <pre><code>Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.tools.JavaFileObject
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Modifier
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.ElementKind
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeVariable
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeKind
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.ArrayType
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.DeclaredType
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.util.Types
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.ExecutableElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.ElementKind
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.ExecutableElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.VariableElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.DeclaredType
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeKind
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.SourceVersion
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced field 'javax.annotation.processing.ProcessingEnvironment processingEnv' in program class butterknife.internal.ButterKnifeProcessor
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.tools.Diagnostic$Kind
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.util.Elements
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.PackageElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.DeclaredType
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.ExecutableElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.VariableElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.tools.JavaFileObject
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Modifier
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.ElementKind
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeKind
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.util.Types
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.SourceVersion
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.tools.Diagnostic$Kind
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.util.Elements
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.PackageElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.tools.Diagnostic
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.util.Elements
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.util.Types
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.tools.JavaFileObject
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Modifier
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeVariable
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.ArrayType
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.DeclaredType
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeVariable
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeVariable
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.VariableElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.ExecutableElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.VariableElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.DeclaredType
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.type.TypeMirror
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.SourceVersion
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.Element
  Warning:butterknife.internal.ButterKnifeProcessor: can't find referenced class javax.lang.model.element.TypeElement
  </code></pre>
  
  <p>I have added all known rules I can find into the 'proguard-rules.pro' file, please check the below for its content.</p>
  
  <pre><code># Retain generated class which implement Unbinder.
  -keep public class * implements butterknife.Unbinder { public &lt;init&gt;(**, android.view.View); }
  
  # Prevent obfuscation of types which use ButterKnife annotations since the simple name
  # is used to reflectively look up the generated ViewBinding.
  -keep class butterknife.*
  -keepclasseswithmembernames class * { @butterknife.* &lt;methods&gt;; }
  -keepclasseswithmembernames class * { @butterknife.* &lt;fields&gt;; }
  </code></pre>