android-gradle-plugin - 仅测试模块中的等效 androidTestUtil 是什么

标签 android-gradle-plugin android-testing

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

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

但是我现在要转到 test-only module .所有 androidTestImplementation 关键字都变成了 implementation。但是我应该为 androidTestUtil 做什么呢?它应该变成 util 吗?

最佳答案

根据 Android 的 documentation它仍然应该是:

androidTestUtil 'androidx.test:orchestrator:x.x.x'


只要确保你更新

  testOptions {
    execution 'ANDROID_TEST_ORCHESTRATOR'
  }

  testOptions {
    execution 'ANDROIDX_TEST_ORCHESTRATOR'
  }

来源:Android Test Orchestrator not working with Android X

关于android-gradle-plugin - 仅测试模块中的等效 androidTestUtil 是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55349636/

相关文章:

android - 使用 orchestrator 覆盖 android 测试

android - 单元测试的数据库 Assets

android - 如何从测试覆盖范围中排除 Dagger2 类

android - 使用 Robolectric 更改配置

android - 如何忽略 Android 中的测试用例?

android-studio - 在 org.gradle.api.internal.artifacts.dsl.dependencies 类型的对象上找不到参数 [目录 'libs'] 的方法实现()

java - Android Studio - 将字节码转换为 dex 时出错,原因 : Dex cannot parse version 52 byte code

android - 导入项目时Android Studio中的Gradle同步错误

android - 无法应用插件 : 'dexguard' at build. gradle 文件

android - 如何解决[ fatal error ]:序言中不允许包含内容?