java.lang.IllegalStateException: Base context already set

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

java.lang.IllegalStateException: Base context already set
at android.content.ContextWrapper.attachBaseContext(ContextWrapper.java:61)
at android.view.ContextThemeWrapper.attachBaseContext(ContextThemeWrapper.java:45)
at android.app.Activity.attach(Activity.java:4965)
at org.robolectric.util.ReflectionHelpers.callInstanceMethod(ReflectionHelpers.java:195)
at org.robolectric.internal.runtime.Api19RuntimeAdapter.callActivityAttach(Api19RuntimeAdapter.java:19)
at org.robolectric.util.ActivityController.attach(ActivityController.java:56)
at org.robolectric.util.FragmentController.attach(FragmentController.java:35)
at org.robolectric.util.FragmentController$1.run(FragmentController.java:43)
at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:304)
at org.robolectric.util.FragmentController.create(FragmentController.java:40)
at org.robolectric.util.FragmentController.create(FragmentController.java:52)
at com.trello.rxlifecycle.components.RxFragmentLifecycleTest.testRxFragment(RxFragmentLifecycleTest.java:50)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:251)
at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:188)
at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:54)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:152)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.