title: Dagger2 generated classes are not accessible in Android < 5.0
body: <p>I have a project that uses Dagger2 and it's complement Autodagger. My main test devices are Genymotion emulators loaded with KitKat and Lollipop and I switch between them indistinctively.</p>
  <p>Yesterday I found out that running the project on either emulator or a real device with 4.x causes the following exception as soon as the app launches:</p>
  <pre><code>   11-20 15:36:31.637 7189-7189/? E/AndroidRuntime: FATAL EXCEPTION: main
     java.lang.NoClassDefFoundError:   com.chiskosystems.debito.DebitoAppModule_ProvideRestAdapterFactory 
      at com.chiskosystems.debito.DaggerDebitoAppComponent.initialize(DaggerDebitoAppComponent.java:30)
      at com.chiskosystems.debito.DaggerDebitoAppComponent.&lt;init&gt;(DaggerDebitoAppComponent.java:19)
      at com.chiskosystems.debito.DaggerDebitoAppComponent.&lt;init&gt;(DaggerDebitoAppComponent.java:11)
      at com.chiskosystems.debito.DaggerDebitoAppComponent$Builder.build(DaggerDebitoAppComponent.java:72)
      at com.chiskosystems.debito.DebitoApp.setupComponent(DebitoApp.java:130)
      at com.chiskosystems.debito.DebitoApp.onCreate(DebitoApp.java:75)
      at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999)
      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151)
      at android.app.ActivityThread.access$1300(ActivityThread.java:130)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:137)
      at android.app.ActivityThread.main(ActivityThread.java:4745)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:511)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  <p>but a</p>
  <pre><code>find /path/to/project -name DebitoAppModule_ProvideRestAdapterFactory.java
  </code></pre>
  <p>shows a result. Also, the project runs fine in L and M.</p>
  <h1>proguard-rules</h1>
  <pre><code>-dontwarn retrofit.**
  -keep class retrofit.** { *; }
  -keepattributes Signature
  -keepattributes Exceptions
  -keepclassmembers
  
  -keepattributes *Annotation*
  -keepattributes Signature
  -keepattributes InnerClasses
  
  -keep class org.eclipse.mat.** { *; }
  -keep class com.squareup.leakcanary.** { *; }
  </code></pre>
  <h1>Build warnings   <em>(these are only a portion)</em></h1>
  <pre><code>Note: com.google.android.gms.internal.zzlf$1: can't find dynamically referenced class com.facebook.login.LoginResult
  Note: com.google.android.gms.internal.zzlf$1: can't find dynamically referenced class com.facebook.FacebookException
  Note: com.google.android.gms.internal.zzlf$1: can't find dynamically referenced class com.facebook.AccessToken
  Note: com.google.android.gms.internal.zzlf$2: can't find dynamically referenced class com.facebook.SessionState
  Note: com.google.android.gms.maps.internal.zzy: can't find dynamically referenced class com.google.android.gms.maps.internal.CreatorImpl
  Note: com.google.gson.internal.UnsafeAllocator: can't find dynamically referenced class sun.misc.Unsafe
  Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class com.android.org.conscrypt.OpenSSLSocketImpl
  Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl
  Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class android.net.TrafficStats
  Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class android.net.Network
  Note: retrofit.Platform: can't find dynamically referenced class android.os.Build
  Note: retrofit.Platform: can't find dynamically referenced class rx.Observable
  Note: android.support.multidex.MultiDexExtractor accesses a method 'apply()' dynamically
  Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'icon' dynamically
        Maybe this is program field 'android.support.design.R$attr { int icon; }'
        Maybe this is program field 'android.support.design.R$id { int icon; }'
        Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { int icon; }'
        Maybe this is program field 'android.support.v7.appcompat.R$attr { int icon; }'
        Maybe this is program field 'android.support.v7.appcompat.R$id { int icon; }'
        Maybe this is program field 'android.support.v7.mediarouter.R$attr { int icon; }'
        Maybe this is program field 'android.support.v7.mediarouter.R$id { int icon; }'
        Maybe this is program field 'com.chiskosystems.debito.R$attr { int icon; }'
        Maybe this is program field 'com.chiskosystems.debito.R$id { int icon; }'
        Maybe this is program field 'io.fabric.sdk.android.services.settings.AppRequestData { io.fabric.sdk.android.services.settings.IconRequest icon; }'
        Maybe this is program field 'io.fabric.sdk.android.services.settings.AppSettingsData { io.fabric.sdk.android.services.settings.AppIconSettingsData icon; }'
  </code></pre>
  <p>I'm using</p>
  <pre><code>compile 'com.google.dagger:dagger:2.1-SNAPSHOT'
  apt 'com.google.dagger:dagger-compiler:2.1-SNAPSHOT'
  provided 'org.glassfish:javax.annotation:10.0-b28'
  
  apt 'com.github.lukaspili.autodagger2:autodagger2-compiler:1.1'
  compile 'com.github.lukaspili.autodagger2:autodagger2:1.1'
  provided 'javax.annotation:jsr250-api:1.0'
  </code></pre>
  <p>Switching build tools has not helped either. Any pointer to what can be wrong are greatly appreciated</p>
  <h1>EDIT</h1>
  <p>These started appearing and they are constant in each build:</p>
  <pre><code>/home/chisko/AndroidStudioProjects/Debito/app/build/generated/source/apt/debug/com/chiskosystems/debito/ui/activities/activity/DaggerMainActivityComponent.java
  Warning:(54, 75) [unchecked] unchecked method invocation: method create in class MainActivity_MembersInjector is applied to given types
  required: MembersInjector&lt;BaseActivity&gt;,Provider&lt;MainActivityPresenter&gt;
  found: MembersInjector,Provider&lt;MainActivityPresenter&gt;
  Warning:(54, 76) [unchecked] unchecked conversion
  required: MembersInjector&lt;BaseActivity&gt;
  found:    MembersInjector
  Warning:(54, 75) [unchecked] unchecked conversion
  required: MembersInjector&lt;MainActivity&gt;
  found:    MembersInjector
  /home/chisko/AndroidStudioProjects/Debito/app/build/generated/source/apt/debug/com/chiskosystems/debito/ui/activities/splash/DaggerLoginActivityComponent.java
  Warning:(54, 77) [unchecked] unchecked method invocation: method create in class LoginActivity_MembersInjector is applied to given types
  required: MembersInjector&lt;BaseActivity&gt;,Provider&lt;LoginPresenter&gt;
  found: MembersInjector,Provider&lt;LoginPresenter&gt;
  Warning:(54, 78) [unchecked] unchecked conversion
  required: MembersInjector&lt;BaseActivity&gt;
  found:    MembersInjector
  Warning:(54, 77) [unchecked] unchecked conversion
  required: MembersInjector&lt;LoginActivity&gt;
  found:    MembersInjector
  </code></pre>