Espresso测试在无关更改后失败

时间:2017-12-09 04:29:27

标签: android android-studio junit android-espresso

我的espresso咖啡测试正在运行。不幸的是,经过一些随机的更改,我的所有测试都失败了。我根本没见过这个错误信息:

错误讯息: -

java.lang.NoSuchMethodError: No interface method trackUsage(Ljava/lang/String;)V in class Landroid/support/test/internal/runner/tracker/UsageTracker; or its super classes (declaration of 'android.support.test.internal.runner.tracker.UsageTracker' appears in /data/app/mu.organyze.test-1/base.apk)

这是我的依赖: -

dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })

        compile 'com.android.support:appcompat-v7:26.1.0'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
        compile 'com.google.firebase:firebase-auth:10.0.1'
        compile 'com.google.firebase:firebase-database:10.0.1'
        testCompile 'junit:junit:4.12'

        testCompile 'com.android.support.test:rules:1.0.1'
        testCompile 'com.google.dexmaker:dexmaker:1.2'
        testCompile 'org.mockito:mockito-core:2.12.0'
        testCompile 'org.mockito:mockito-android:2.12.0'


        androidTestCompile 'com.android.support:support-annotations:26.1.0'
        androidTestCompile 'com.android.support.test:runner:1.0.1'
        androidTestCompile 'com.android.support.test:rules:1.0.1'
        androidTestCompile 'org.mockito:mockito-core:2.12.0'
        androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
        androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'


        androidTestUtil 'com.android.support.test:orchestrator:1.0.1'
        androidTestCompile 'org.hamcrest:hamcrest-integration:1.3'
    }

1 个答案:

答案 0 :(得分:0)

只需将其添加到依赖项: -

  

com.android.support.test.espresso:浓咖啡核:3.0.0