title: Dagger inject interface into private fields
body: <p>I want inject interface implementation in abstract class constructor and use it in child class.</p>
  
  <p>I have compile time errors:</p>
  
  <pre><code>Error:Gradle: Dagger does not support injection into private fields
  Error:Gradle: Example.A cannot be provided without an @Provides-annotated method.
  Error:Gradle: Example.B cannot be provided without an @Inject constructor or from an @Provides-annotated method.
  Error:Gradle: Execution failed for task ':app:compileDemoDebugJavaWithJavac'.
  &gt; Compilation failed; see the compiler error output for details.
  </code></pre>
  
  <p>Example in kotlin.</p>
  
  <pre><code>   object Example {
      interface IData {
  
          fun foo() {
          }
      }
  
      class Data : IData {
  
      }
  
      @Module
      class DataModel {
          @Provides
          fun data(): IData = Data()
      }
  
      @Singleton
      @Component(modules =
      arrayOf(DataModel::class)
      )
      interface Injector {
          fun inject(a: A)
          fun inject(b: B)
      }
  
      val graph: Injector = DaggerInjector.builder().
              dataModel(DataModel()).
              build()
  
      abstract class A {
  
          @Inject var data: IData ? = null
  
          public open fun setUp() {
              graph.inject(this)
          }
      }
  
      open class B : A() {
  
          override fun setUp() {
              super.setUp()
              data!!.foo()
          }
      }
  
      fun bar() {
          val a = B()
          a.setUp()
      }
  }
  </code></pre>
  
  <p>versions:</p>
  
  <ul>
  <li>com.android.tools.build:gradle:2.1.2 </li>
  <li>ext.kotlin_version = '1.0.3'</li>
  <li>compile 'com.google.dagger:dagger:2.4' </li>
  <li>provided 'org.glassfish:javax.annotation:10.0-b28' </li>
  <li>kapt 'com.google.dagger:dagger-compiler:2.4'</li>
  </ul>
  
  <hr>
  
  <p>Here is case. Decompiled java</p>
  
  <pre><code>  public static class A {
    @Inject
    @Nullable
    private Example.IData data;
  
    @Nullable
    protected final Example.IData getData() {
       return this.data;
    }
  
    protected final void setData(@Nullable Example.IData &lt;set-?&gt;) {
       this.data = &lt;set-?&gt;;
    }
  
    public void setUp() {
       Example.INSTANCE.getGraph().inject(this);
    }
  </code></pre>
  
  <p>}</p>