Sunday, February 17, 2019

When Robolectric crashes with a "not mocked" error

One student was trying to run our Robolectric-based test suite, but found that it always crashed, saying that a method in android.util.SparseArray was not mocked. It looked like that was being used internally by Robolectric, not by the student's code. The problem was solved by removing the .m2 cache folder in the user profile folder, thereby forcing Robolectric to redownload some libraries.

No comments:

Post a Comment