After inspiration from this template, I was able to get roblolectric and espresso tests working with android and gradle. The key was to store robolectric in it\'s own module. Ho
Theoretically, instead of copying those files into the local maven repository, you should be able to use android repository directly:
apply plugin: 'java'
repositories {
def androidHome = System.getenv("ANDROID_HOME")
maven {
url "$androidHome/extras/android/m2repository/"
}
}
Note, that you have to install Android Support Repository & Google Repository first through the SDK Manager.