Error when generating code coverage report for androidTest instrumented testcases with dagger
Asked Answered
A

1

0

I want to run createDebugCoverageReport gradle task.But after run task is failing and giving below error.

 java.lang.NoClassDefFoundError: dagger.shaded.auto.common.BasicAnnotationProcessor
  at java.lang.Class.classForName(Native Method)
  at java.lang.Class.forName(Class.java:324)
  at android.support.test.internal.runner.TestLoader.doLoadClass(TestLoader.java:92)
  at android.support.test.internal.runner.TestLoader.loadIfTest(TestLoader.java:113)
  at android.support.test.internal.runner.TestRequestBuilder.loadClassesFromClassPath(TestRequestBuilder.java:801)
  at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:747)
  at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:354)
  at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:260)
   at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1970)

Below are the dagger dependencies used

 compile 'com.google.dagger:dagger:2.4'
 annotationProcessor 'com.google.dagger:dagger-compiler:2.4'
 androidTestCompile 'com.google.dagger:dagger-compiler:2.4'

Please suggest, How I can remove this error.

Aletaaletha answered 10/3, 2017 at 9:2 Comment(0)
S
0

due what I found, it's a conflict with dagger-producers extensions - auto-value-gson works fine with dagger 2.0.2 - 2.4, but when dagger-producers (any version) is added as extra dependency to project following exception is thrown.

our problem is you are hitting the dex limit, which is different than this ticket. Make sure you're adding those dependencies to the apt config, not compile.

Superannuation answered 10/3, 2017 at 9:44 Comment(1)
yes I have extend MultiDexApplication and make it to support more then 64k methods. anything else which I can tryAletaaletha

© 2022 - 2024 — McMap. All rights reserved.