What is the difference between these two import statements? (in build.gradle
):
testCompile 'junit:junit:4.12'
androidTestCompile 'junit:junit:4.12'
What is the difference between these two import statements? (in build.gradle
):
testCompile 'junit:junit:4.12'
androidTestCompile 'junit:junit:4.12'
There's a great answer here explaining the difference:
Simply
testCompile
is the configuration for unit tests (located insrc/test
) andandroidTestCompile
is used for the test API (located insrc/androidTest
)....
The main distinction between the two is the
test
sourceset runs in a regular Java JVM, whereas theandroidTest
sourceset tests run on an Android device (or an emulator).