I am setting up Robolectric for a project that uses multi dex. I am using Robolectric 3.0 RC3, which should support Multidex without throwing a "Multi dex installation failed" exception.
testCompile('org.robolectric:robolectric:3.0-rc3')
My test test is in src / test / java / SandwichTest:
@RunWith(RobolectricGradleTestRunner.class)
public class SandwichTest {
@Test
public void firstTest() { }
}
I have a global configuration file for loading ShadowMultiDex into src / test / resources with the name robolectric.properties according to the instructions on the Robolectric website :
shadows=org.robolectric.shadows.ShadowMultiDex
When I run my SandwichTest sample, I get this exception:
Could not load class: org.robolectric.shadows.ShadowMultiDex
java.lang.RuntimeException: Could not load class: org.robolectric.shadows.ShadowMultiDex
at org.robolectric.annotation.Config$Implementation.parseClass(Config.java:147)
It looks like Robolectric is finding my configuration file, but cannot load the ShadowMultiDex class. Trying to add shadow multidex module to my gradle file manually:
testCompile('org.robolectric:shadows-multidex:3.0-SNAPSHOT')
or
testCompile('org.robolectric:shadows-multidex')
.
, ?