I found that "upgrading" my reference to UIAutomator in build.gradle to 2.1.2 broke any references I had to the UiDevice class. In fact, a lot seems to have changed but I'm finding nothing explaining it.
Can anyone shed some light on what is (apparently) about to change?
This works:
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
This does not:
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Dependencies from build.gradle follow (made a mess of by trying to figure this out):
testCompile 'junit:junit:4.12'
// Optional -- Mockito framework
testCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// Optional -- UI testing with UI Automator
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
androidTestCompile 'com.android.support:support-annotations:26.0.0'
androidTestCompile 'com.android.support.test:runner:1.0.0'
androidTestCompile 'com.android.support.test:rules:1.0.0'
// Optional -- Hamcrest library
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
// Optional -- UI testing with Espresso
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.android.support:design:26.0.0'
compile 'com.android.support:support-v4:26.0.0'