Skip to content Skip to sidebar Skip to footer

Mockito + Dexmaker On Android 2

I saw this question: Mockito + Dexmaker on Android And after the using the answer I came into another problem: java.lang.RuntimeException: java.lang.IllegalArgumentException: Optim

Solution 1:

I found the solution on http://code.google.com/p/dexmaker/issues/detail?id=2

What worked was putting the following line in the setUp():

System.setProperty("dexmaker.dexcache", getInstrumentation().getTargetContext().getCacheDir().getPath());

Let's hope a fix will be made soon instead of using this workaround.


Solution 2:

//Depending on the type of test, you can also do this:
System.setProperty("dexmaker.dexcache", getContext().getCacheDir().getPath());

Post a Comment for "Mockito + Dexmaker On Android 2"