Setup Robolectric in offline mode in android studio

721 Views Asked by At

I am trying to Setup Robolectric in offline mode in android studio. I need it in offline mode as we need to run the tests on a Jenkins server which has no network access.

I followed the "Using Robolectric in offline mode" section in the below link:

http://codeblast.com/

I used the pom file as given in the link to download all the dependent jars to setup robolectric in offline mode. I included the jars in Libs folder and added them as dependencies in android studio. When I run a simple test using the following command in terminal:

./gradlew clean testDebug --offline

I am getting the following error:

Error:Gradle: Execution failed for task ':app:preDexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/m1018337/jdk1.7.0_55/bin/java'' finished with non-zero exit value 1

I googled and tried a few fixes for the above error but couldn't succeed.
I need help in setting up robolectric in offline mode. Thanks in advance.

0

There are 0 best solutions below