I am attempting to follow the Android ActivityScenario
documentation to write Robolectric-based tests. Adding androidTestImplementation "androidx.test.core:app:1.2.0"
to my build.gradle
allows me to add import androidx.test.core.app.ActivityScenario;
to my test class and use the ActivityScenario
class. Despite this, gradle is reporting Failed to resolve: androidx.test.core:app:1.2.0
which means I can't run the tests.
I have tried cleaning the build, re-running the gradle sync, invalidating caches and restarting. I have also tried importing other packages from https://mvnrepository.com/artifact/androidx.test, none of which result in ActivityScenario
being found. In particular, I would expect androidTestImplementation "androidx.test:core:1.2.0"
to work but it does not.
Versions:
- Android Studio 3.5
- Robolectric 4.3.1