android - Adding Espresso to instrumentTest dependency when dagger is already included in compile dependencies -


i have gradle project (using gradle 1.9) , trying add espresso (from https://github.com/jakewharton/double-espresso) project has dagger in compile dependencies.

here dependency structure:

dependencies {

compile 'com.crashlytics.android:crashlytics:1.+' compile 'com.commonsware.cwac:merge:1.0.1'  compile 'com.squareup.dagger:dagger:1.2.0'  compile 'com.squareup.dagger:dagger-compiler:1.2.0' compile 'com.mcxiaoke.volley:library:1.0.+'  compile 'com.google.code.gson:gson:2.2.4'  compile 'com.squareup.okhttp:okhttp:1.5.0' compile 'com.android.support:support-v4:19.0.1' compile 'com.android.support:appcompat-v7:19.0.1' compile 'com.google.guava:guava:16.0'  instrumenttestcompile('com.jakewharton.espresso:espresso:1.1-r2') {     exclude group: 'com.squareup.dagger'     exclude group:'com.google.guava', module:'guava' } instrumenttestcompile('com.jakewharton.espresso:espresso-support-v4:1.1-r2') {     exclude group:'com.google.guava', module:'guava'     exclude group:'com.android.support', module:'support-v4'     exclude group: 'com.squareup.dagger' } 

}

now problem when start tests through "gradle connectedinstrumenttest" shortly after test starts (and see activity getting fired), following error:

...activity.mainactivitytest > testitemtext[nexus 5 - 4.4.2] failed java.lang.illegalstateexception: errors creating object graph: com.google.android.apps.common.testing.ui.espresso.failurehandler not bound key com.google.android.apps.common.testing.ui.espresso.failurehandler required class com.google.android.apps.common.testing.ui.espresso.base.baselayermodule :clioandroid:connectedinstrumenttest failed

when comment out exclude group: 'com.squareup.dagger' error: instrumentation run failed due 'java.lang.illegalaccesserror' expected according "http://b.android.com/65445".

i assume problem adding "exclude group: 'com.squareup.dagger'" messes daggers object graph espresso. haven't been able find workaround that. appreciated.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -