【问题标题】:espresso-contrib 3.3.0 works fine but any newer version results in build failuresespresso-contrib 3.3.0 工作正常,但任何较新的版本都会导致构建失败
【发布时间】:2023-01-27 01:12:05
【问题描述】:

我们已经定义了依赖关系androidTestImplementation("androidx.test.espresso:espresso-contrib:3.3.0")。 仪器测试工作正常。 但是当我们尝试更新到更新版本(例如 3.4.0 或 3.5.0)时,我们收到以下错误:

Instrumentation did not complete:
Instrumentation code: 0
Instrumentation result bundle: 

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:connectedDevShortTimeoutDebugAndroidTest'.
> There were failing tests. See the report at: 

该报告显示以下内容:

我找到了Android Tests: No tests foundGradle: No tests found,但没有人指出解决方案。

使用了以下 androidTestImplementation 依赖项:

androidTestImplementation(project(":sharedTest"))
androidTestImplementation("androidx.test:core-ktx:1.5.0")
androidTestImplementation("androidx.test:rules:1.5.0")
androidTestImplementation("androidx.test:runner:1.5.0")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
androidTestImplementation("androidx.test.ext:junit-ktx:1.1.4")
androidTestImplementation("androidx.test.espresso:espresso-contrib:3.3.0")
androidTestImplementation("com.microsoft.appcenter:espresso-test-extension:1.5")
androidTestImplementation("org.mockito:mockito-android:$mockitoTestVersion")
androidTestImplementation("org.mockito.kotlin:mockito-kotlin:4.0.0")
androidTestUtil("androidx.test:orchestrator:1.4.2")

有没有人有提示或有任何机会解决方案?

【问题讨论】:

  • 找到解决办法了吗?
  • 不,对不起。仍未解决...

标签: android-espresso android-testing


【解决方案1】:

检查 Logcat 是否有错误。我遇到了一个由 Espresso 3.4.0 中的 protobuf-lite 更新引起的 Firebase 初始化错误。我不得不从 espresso-contrib 中排除这个模块(如果你使用它,也从 espresso-accessibility 中排除)。

androidTestImplementation('androidx.test.espresso:espresso-contrib:3.5.1') {
    exclude module: 'protobuf-lite'
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-10-04
    • 1970-01-01
    • 2010-10-27
    • 1970-01-01
    • 2012-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多