dexcache == null error
See original GitHub issueThis issue from the old google code project: https://code.google.com/p/dexmaker/issues/detail?id=2 is still valid as of the released 1.2 version
Java.lang.IllegalArgumentException: dexcache == null (and no default could be found; consider setting the 'dexmaker.dexcache' system property)
at com.google.dexmaker.DexMaker.generateAndLoad(DexMaker.java:359)
at com.google.dexmaker.stock.ProxyBuilder.buildProxyClass(ProxyBuilder.java:252)
at com.google.dexmaker.mockito.DexmakerMockMaker.createMock(DexmakerMockMaker.java:51)
at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:41)
...
However, I verified that it has been fixed in the current github repository (last commit March 12th 2015 - ca74669):
- git clone https://github.com/crittercism/dexmaker.git
- cd dexmaker
- mvn install -Dmaven.test.skip=true
- cp -R ~/.m2/repository/com/google/dexmaker $ANDROID_HOME/extras/android/m2repository/com/google
- and then update project dependency to 1.3-SNAPSHOT
It would be nice to have a 1.3 release so that we can take the workaround lines out of the test setUp() methods: System.setProperty(“dexmaker.dexcache”, getContext().getCacheDir().getPath());
Thanks!
Issue Analytics
- State:
- Created 8 years ago
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Developers - dexcache == null error - - Bountysource
This issue from the old google code project: https://code.google.com/p/dexmaker/issues/detail?id=2 is still valid as of the released 1.2 ...
Read more >android - Robolectric = Mockito : Cannot Create Mock or Spy ...
I just found this workaround: https://comadeblog.wordpress.com/2013/11/12/dexcachenull-for-mockito-on-robolectric/comment-page-1/. TL;DR:.
Read more >dexmaker - issue #2 - Google Code
Code should work but i get an error: java.lang.IllegalArgumentException: dexcache == null (and no default could be found; consider setting ...
Read more >Mockito & Android How-To - Kevin Schultz
... I have to hunt down the solution to the 'dexcache == null' error. ... simply setting the System property as specified in...
Read more >libart/src/main/java/java/lang/Class.java - platform/libcore
this will be String[][]). null for non-array classes. */. private transient Class<?> componentType;. /**. * DexCache of resolved constant pool entries.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mjohenneken Thanks! Adding the
dexmaker-dx
dependency worked for me. 👍Hey guys I found a workaround for this that works:
https://comadeblog.wordpress.com/2013/11/12/dexcachenull-for-mockito-on-robolectric/comment-page-1/
Basically use 1.9 version of Mockito:
compile 'org.mockito:mockito-core:1.9.0'