I just wanted to write my first android instrumentation test. I added
sourceSets {
main {
dirs.each { dir ->
java.srcDirs "src/${dir}/java"
res.srcDirs "src/${dir}/res"
}
}
androidTest.setRoot('tests')
androidTest.java.srcDirs = ['tests/src']
}
same as I saw in the examples over:
/android-studio/sdk/samples/android-19/testing/ActivityInstrumentation/ActivityInstrumentationSample/build.gradle
In the example it looks fine (I'm able to see the tests
folder colored
in android studio
) however in my project I get this error:
Error:(19, 0) Could not find property 'dirs' on source set main.
Not sure what is the different as both me and the example uses:
compileSdkVersion 19
buildToolsVersion "20.0.0"
http://stackoverflow.com/questions/24597680/how-to-use-standard-tests-directory-with-android-and-gradle
(no answers here so posted to here as well)