Dagger Dependencies When Overriding a Graph with a Layout Module Raises NoClassDefFoundError

I transfer the project to dagger 1.2.2. I would like to redefine some dependencies for functional tests. To do this, I turned on the dagger compiler depending on androidTest-build (?):

apt "com.squareup.dagger:dagger-compiler:$daggerVersion" compile "com.squareup.dagger:dagger:$daggerVersion" androidTestApt "com.squareup.dagger:dagger-compiler:$daggerVersion 

Now the compiler complains that it cannot find the class (I think because both assemblies now contain transitive dependencies of the compiler dagger):

 Error:Execution failed for task ':app:compileDebugAndroidTestJava'. > java.lang.NoClassDefFoundError: javax/inject/Scope 

Looking back on github, it seems that the approach should work without manually excluding the material.

+1
source share
1 answer

Nevermind Actually reading the entire assembly file helps a lot.

Due to the previous -foo dependency, I had a directive that explicitly excluded the missing dependency:

 configurations { androidTestCompile.exclude(group:'javax.inject') } 

Removal that fixed it.

0
source

All Articles