In my case, adding below to my build.gradle fix the issue,
testOptions {
unitTests {
includeAndroidResources = true
all {
it.systemProperty("robolectric.dependency.repo.url", "https://oss.sonatype.org/service/local/repositories/releases/content/")
}
}
}
From the error message, I searched "android-all" from , and found its path: https://oss.sonatype.org/service/local/repositories/releases/content/org/robolectric/android-all/15-robolectric-12650502/android-all-15-robolectric-12650502.jar, so I set the repo url to https://oss.sonatype.org/service/local/repositories/releases/content/ and it worked.