Robolectric: Robolectric Manually Downloads and takes forever

Created on 26 Apr 2018  路  3Comments  路  Source: robolectric/robolectric

Description

Am trying to carry out unit test, but it begins to download this
Downloading: org/robolectric/android-all/8.1.0-robolectric-4611349/android-all-8.1.0-robolectric-4611349.jar from repository central at http://repo1.maven.org/maven2

I would really love to download this manually and place it in any of the associated folders.
How will do this?, What folder should i be looking at

I have tried the solution in this article http://codeblast.com/2015/05/13/using-robolectric-in-offline-mode/,
I dont use maven.
Am carrying out test, in my local development machine, not in a CI
and moreover, i search the whole directory for sdkConfig.java, didn't found any

Steps to Reproduce

Robolectric & Android Version

Link to a public git repo demonstrating the problem:

Most helpful comment

I am just learning about Robolectric so this could be wrong, but when I followed the instructions on their config page, it started loading from local path.

I use gradle.

testOptions {
    unitTests.all {
        systemProperty 'robolectric.dependency.repo.url', 'https://repo1.maven.org/maven2/'
        systemProperty 'robolectric.dependency.repo.id', 'local'
    }
}

Navigate to System Properties section of Configuring Robolectric

All 3 comments

I had similar issue on one of my CI servers where Robolectric would try to download all these dependencies:
android-all/8.1.0-robolectric-r4458339/android-all-8.1.0-robolectric-r4458339.pom
android-all/7.1.0_r7-robolectric-0/android-all-7.1.0_r7-robolectric-0.pom

And then would fail during one of the jar downloads by saying
Error transferring file: java.security.ProviderException: Could not derive key

The way i fixed it was by forcing Robolectric to use only SDK 21 for all of my tests. Here's how it looked like:

android {
  testOptions {
    unitTests.all {
      systemProperty 'robolectric.enabledSdks', '21'
    }
  }
}

Saw this block from Robolectric website itself
http://robolectric.org/configuring/

I am just learning about Robolectric so this could be wrong, but when I followed the instructions on their config page, it started loading from local path.

I use gradle.

testOptions {
    unitTests.all {
        systemProperty 'robolectric.dependency.repo.url', 'https://repo1.maven.org/maven2/'
        systemProperty 'robolectric.dependency.repo.id', 'local'
    }
}

Navigate to System Properties section of Configuring Robolectric

Was this page helpful?
0 / 5 - 0 ratings