首页 > 解决方案 > 什么是仅测试模块中的等效 androidTestUtil

问题描述

最初,我在我的应用模块中使用 Android Test Orchestrator。所以我的 build.gradle 文件中有这一行:

dependencies {
    androidTestUtil "androidx.test:orchestrator...`
    ...
}

但是,我现在正在转向仅测试模块。所有的androidTestImplementation关键字都变成了just implementation。但是我该怎么办androidTestUtil?它应该变得公正util吗?

标签: android-gradle-pluginandroid-testing

解决方案


根据 Android 的文档,它仍然应该是:

androidTestUtil 'androidx.test:orchestrator:xxx'


只要确保你更新

  testOptions {
    execution 'ANDROID_TEST_ORCHESTRATOR'
  }

  testOptions {
    execution 'ANDROIDX_TEST_ORCHESTRATOR'
  }

学分:Android Test Orchestrator 不适用于 Android X


推荐阅读