I have a Test suite (for my Android application) that can work in the Junit approach (right click on the testClass file and run it) in Android Studio. It depends on the Android module that Robolectric uses. It worked fine until Android Studio 1.3.1.
However, when I switch to Android Studio 1.4, when I synchronize my Gradle file, there is a warning there
Warning:Ignoring dependency of module 'app' on module 'unit-tests'. Java modules cannot depend on Android modules
Thus, my test also cannot be run, since all my Android classes, for example. AppCompat is no longer detected.
Part of my Gradle code as below: app is my android module.
def androidModule = project(':app')
dependencies {
testCompile androidModule
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:2.4'
testCompile 'org.mockito:mockito-all:1.9.5'
}
https://code.google.com/p/android/issues/detail?id=188880&q=label%3AReportedBy-Developer&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars.
- , Android Studio 1.4, - Gradle Android Studio 1.4?