Skip to content Skip to sidebar Skip to footer

Robolectric With Activeandroid Setup Nullpointerexception On Activeandroid$reflectionutils

I am trying to implement robolectric testing in an existing app. I can run simple static tests but when I add testing with ActiveAndroid I get NullPointerExceptions, I think Active

Solution 1:

Ah, we had a similar issue. We resolved it by next Robolectric feature http://robolectric.org/custom-test-runner/

We moved created method:

@OverrideprotectedvoidattachBaseContext(Context base) {
    super.attachBaseContext(base);
    installMultiDex();
}

protectedvoidinstallMultiDex() {
    MultiDex.install(this);
}

And overrided it in the test application:

@OverrideprotectedvoidinstallMultiDex() {
    //don't do anything
}

Post a Comment for "Robolectric With Activeandroid Setup Nullpointerexception On Activeandroid$reflectionutils"