Мне нужно разработать инструментальный тест для моего приложения для Android, а также мне нужно реализовать интерфейс IdlingResource для моего приложения, чтобы сообщить Espresso, что активность простаивает; поэтому я должен добавить зависимости Espresso два раза, один в обычной компиляции и один в тестовой компиляции, выглядит так:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
[...]
compile('com.android.support.test.espresso:espresso-core:2.2.2') {
exclude module: 'support-annotations'
}
androidTestCompile('com.android.support.test:runner:0.5') {
exclude module: 'support-annotations'
}
androidTestCompile('com.android.support.test:rules:0.5') {
exclude module: 'support-annotations'
}
// The following lib is already imported in a standard way, but needs to be imported again
// in the test environment.
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
exclude module: 'support-annotations'
}
androidTestCompile('com.android.support.test.espresso:espresso-intents:2.2.2') {
exclude module: 'support-annotations'
}
[...]
}
Но обычная компиляция приложения не работает:
Error:Execution failed for task ':app:processDebugAndroidTestResources'.
> java.io.FileNotFoundException: [...]/app/build/intermediates/symbols/androidTest/debug/R.txt (No such file or directory)
Я делаю что-то неправильно?