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
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/
@Zedonboy You might try something like: https://gist.github.com/simtel12/13ff3e57c37e78e468502b51ebb0f4f2
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
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.
Navigate to System Properties section of Configuring Robolectric