I am using Android Studio 1.2 and Windows 7
When running a robolectric test following this example:
@RunWith(CustomRobolectricRunner.class)
@Config(e
This seems to be a proxy problem. When behind proxy you have to specify proxy settings for maven at {userHome}/.m2/settings.xml
my settings.xml looks now like:
<settings>
<proxies>
<proxy>
<active>true</active>
<host>proxy.host</host>
<port>3128</port>
</proxy>
</proxies>
</settings>
below not working !!
<settings>
<proxies>
<proxy>
<id>proxy-https</id>
<active>true</active>
<protocol>https</protocol>
<host>proxy.host</host>
<port>3128</port>
</proxy>
<proxy>
<id>proxy-http</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.host</host>
<port>3128</port>
</proxy>
</proxies>
</settings>
I've been able to fix the same issue by overriding Robolectric Maven repository URL.
Sonatype is not available for some reason and Maven Central moved to HTTPS starting from Jan 15, 2020. So, I've decided to use Maven Central URL but with a secure scheme.
Editing the system property which is used by Robolectric RoboSettings class allowed me to use a different URL.
android {
testOptions {
unitTests.all {
systemProperty 'robolectric.dependency.repo.url', 'https://repo1.maven.org/maven2'
}
}
}