4

Initially I was using Android Test Orchestrator in my app module. So I had this line in my build.gradle file:

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

However I am now moving to a test-only module. All of the androidTestImplementation keywords become just implementation. But what should I do for androidTestUtil? Should it become just util?

tir38
  • 9,810
  • 10
  • 64
  • 107

1 Answers1

1

According to Android's documentation it should still be:

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


Just make sure you update

  testOptions {
    execution 'ANDROID_TEST_ORCHESTRATOR'
  }

to

  testOptions {
    execution 'ANDROIDX_TEST_ORCHESTRATOR'
  }

Credit: Android Test Orchestrator not working with Android X

  • I don't see where in the documentation you linked to that it mentions androidTestUtil or orchestrator – tir38 Aug 29 '19 at 23:52
  • Sorry, I linked the wrong android documentation. I just edited my comment with the right link. It shows an example of it being used. https://developer.android.com/training/testing/junit-runner#using-android-test-orchestrator – Trae Wright Aug 30 '19 at 16:30
  • Yep so in that link they are showing an app or library module, not a test only module. You can tell because they use `androidTestImplementation` not `implementation` on the runner. I still don't see how this solution works for test-only modules. – tir38 Aug 30 '19 at 18:53
  • @tir38 did you end up finding a solution to this? – natez0r Oct 05 '21 at 22:13