java.lang.NoClassDefFoundError: org/robolectric/shadows/ShadowContext

GitHub | baranusta | 9 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    LocalBroadcastManager register error with Robolectric 3.1.2

    GitHub | 9 months ago | baranusta
    java.lang.NoClassDefFoundError: org/robolectric/shadows/ShadowContext
  2. 0

    GitHub comment 2613#240414514

    GitHub | 9 months ago | jongerrish
    java.lang.NoClassDefFoundError: org/robolectric/shadows/ShadowContext

    Root Cause Analysis

    1. java.lang.NoClassDefFoundError

      org/robolectric/shadows/ShadowContext

      at org.robolectric.shadows.support.v4.ShadowLocalBroadcastManager.shadowOf()
    2. org.robolectric.shadows
      ShadowLocalBroadcastManager.getInstance
      1. org.robolectric.shadows.support.v4.ShadowLocalBroadcastManager.shadowOf(ShadowLocalBroadcastManager.java:42)
      2. org.robolectric.shadows.support.v4.ShadowLocalBroadcastManager.getInstance(ShadowLocalBroadcastManager.java:33)
      2 frames
    3. Android Support v4
      LocalBroadcastManager.getInstance
      1. android.support.v4.content.LocalBroadcastManager.getInstance(LocalBroadcastManager.java)
      1 frame
    4. UI.ProductDetail
      ProductStampsTest.setUp
      1. UI.ProductDetail.ProductStampsTest.setUp(ProductStampsTest.java:71)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    6. JUnit
      RunAfters.evaluate
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      4. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
      5. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      5 frames
    7. Roboelectric
      RobolectricTestRunner.runChild
      1. org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:250)
      2. org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:176)
      3. org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:49)
      3 frames
    8. JUnit
      ParentRunner$2.evaluate
      1. org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      2. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      3. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      4. org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      5. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      5 frames
    9. Roboelectric
      RobolectricTestRunner$1.evaluate
      1. org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:142)
      1 frame
    10. JUnit
      JUnitCore.run
      1. org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      2. org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      2 frames
    11. IntelliJ junit4 module
      JUnit4IdeaTestRunner.startRunnerWithArgs
      1. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
      1 frame
    12. IDEA
      JUnitStarter.main
      1. com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
      2. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
      2 frames
    13. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    14. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
      1 frame