Skip to content Skip to sidebar Skip to footer

Robolectric Tests Fail On Shadowof

What might be the problem? My Robolectric tests ran fine a while ago, but now they all fail with the same error. The only change I can think of is changing to version 2.1.1. I'm ru

Solution 1:

Apparently the error occurred because of this in the onCreate of my application class:

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());

Changed the getBaseContext() to this and the tests work again.


Post a Comment for "Robolectric Tests Fail On Shadowof"