0

I'm using dagger for dependency injection. I've been building my app and testing it with android Lollipop so far. When i try to run the app in a lower android api then the app crashes.

Issues detected.

  • When i launch the app i see a few errors of type 'Could not find class'. These errors occur only in android api version < 21.

    10882-10882/? E/dalvikvm﹕ Could not find class 'com.app.android.misc.EndpointException', referenced from method com.app.android.modules.ApiModule.provideEndpoint
    07-20 10:45:48.916  10882-10882/? E/dalvikvm﹕ Could not find class 'com.app.android.api.endpoints.EndpointRelease', referenced from method com.app.android.modules.ApiModule.provideEndpoint
    07-20 10:45:48.920  10882-10882/? E/dalvikvm﹕ Could not find class 'com.app.android.api.endpoints.EndpointStage', referenced from method com.app.android.modules.ApiModule.provideEndpoint
    07-20 10:45:48.920  10882-10882/? E/dalvikvm﹕ Could not find class 'com.app.android.api.endpoints.EndpointDev', referenced from method com.app.android.modules.ApiModule.provideEndpoint
    07-20 10:45:48.924  10882-10882/? E/dalvikvm﹕ Could not find class 'com.app.android.api.ApiRequestInterceptor', referenced from method com.app.android.modules.ApiModule.provideInterceptor
    
  • Then the app crashes with the following error:

    07-20 10:45:48.940  10882-10882/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.app.android, PID: 10882
    java.lang.RuntimeException: Unable to create application com.app.android.IPApplication: java.lang.IllegalStateException: Module adapter for class com.app.android.modules.AppModule could not be loaded.
    Caused by: java.lang.IllegalStateException: Module adapter for class com.inperson.android.modules.AppModule could not be loaded. Please ensure that code generation was run for this module.
  • Also there's this error after the app crashes but i'm not sure it's related:
   07-20 10:45:56.284  15671-15687/system_process E/WindowManager﹕ Starting window AppWindowToken{529c2338 token=Token{52a91a78 ActivityRecord{529ee900 u0 com.app.android/.InitActivity t8}}} timed out
Arthur
  • 3,636
  • 5
  • 19
  • 25

1 Answers1

3

It was an issue with multidex enabled. Fixed by adding the below line in my Application class

@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
}
Arthur
  • 3,636
  • 5
  • 19
  • 25