title: Robolectric: NullPointerException in setupActivity()
body: <p>I'm trying to use Robolectric for testing my activities, but I'm always getting a NPE, when trying to setup the Activity with Robolectric. I have followed the guide from the <a href="http://robolectric.org" rel="noreferrer">robolectric.org</a> website.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@Config(constants = BuildConfig.class, sdk = Build.VERSION_CODES.LOLLIPOP, manifest = "src/main/AndroidManifest.xml")
  @RunWith(RobolectricTestRunner.class)
  @Ignore
  public class MainActivityUnitTest {
  
      private MainActivity activity;
  
      @Before
      public void setup() {
          activity = Robolectric.setupActivity(MainActivity.class);
      }
  
      @Test
      public void dummyTest() {
          assertTrue(true);
      }
  } 
  </code></pre>
  
  <p>Some other information: I'm using Dagger2 for DI in the project.
  The exception I'm getting:</p>
  
  <pre><code>java.lang.NullPointerException
      at org.robolectric.internal.ShadowExtractor.extract(ShadowExtractor.java:5)
      at org.robolectric.Shadows.shadowOf(Shadows.java:1165)
      at org.robolectric.shadows.CoreShadowsAdapter.getMainLooper(CoreShadowsAdapter.java:42)
      at org.robolectric.util.ComponentController.&lt;init&gt;(ComponentController.java:31)
      at org.robolectric.util.ActivityController.&lt;init&gt;(ActivityController.java:35)
      at org.robolectric.util.ActivityController.of(ActivityController.java:27)
      at org.robolectric.Robolectric.setupActivity(Robolectric.java:46)
      at com.me.myapplication.MainActivityUnitTest.setup(MainActivityUnitTest.java:32)
  </code></pre>