Android Studio 3.0 Beta2
classpath \'com.android.tools.build:gradle:3.0.0-beta3\'
testCompile \'org.robolectric:robolectric:3.4.2\'
Test class that
The Robolectric documentation states that the following configuration should be used with Android Studio 3.x:
android {
testOptions {
unitTests.includeAndroidResources true
}
}
In my case the following solved my issue: "Problem is related to android studio. Go to 'Run' -> 'Edit configurations...' and change 'Working directory' value to $MODULE_DIR$
Run your tests.
More info here under 'Building with Android Studio'."
reference: https://github.com/robolectric/robolectric/issues/2653