title: Running Gradle test with Robolectric and AppCompat results in NullPointerException
body: <p>As the title says running Robolectric tests with Gradle results in <code>NullPointerException</code> while calling <code>Robolectric.buildActivity(MyActivity.class).create().get();</code></p>
  
  <p><strong>build.gradle</strong> (based on <a href="https://stackoverflow.com/questions/16649397/robolectric-with-gradle-resources-not-found">this answer</a>)</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:0.5.+'
      }
  }
  
  repositories {
      mavenCentral()
      maven {
          url 'https://oss.sonatype.org/content/repositories/snapshots/'
      }
  }
  
  apply plugin: 'android'
  
  android {
      compileSdkVersion 18
      buildToolsVersion "18.0.1"
  
      defaultConfig {
          minSdkVersion 7
          targetSdkVersion 16
      }
  }
  
  sourceSets {
      testLocal {
          java.srcDir file('src/test/java')
          resources.srcDir file('src/test/resources')
      }
  }
  
  dependencies {
      compile 'com.android.support:support-v4:18.0.0'
      compile 'com.android.support:appcompat-v7:18.0.+'
      compile project(':Libraries:ViewPagerIndicator')
  
      testLocalCompile project(':Libraries:appcompat')
      testLocalCompile 'junit:junit:4.8.2'
      testLocalCompile 'org.robolectric:robolectric:2.1'
      testLocalCompile 'com.google.android:android:4.1.1.4'
      testLocalCompile 'com.google.android:support-v4:r6'
      testLocalCompile 'org.roboguice:roboguice:2.0'
  }
  
  task localTest(type: Test, dependsOn: assemble) {
      testClassesDir = sourceSets.testLocal.output.classesDir
  
      android.sourceSets.main.java.srcDirs.each { dir -&gt;
          def buildDir = dir.getAbsolutePath().split('/')
          buildDir =  (buildDir[0..(buildDir.length - 4)] + ['build', 'classes', 'debug']).join('/')
  
          sourceSets.testLocal.compileClasspath += files(buildDir)
          sourceSets.testLocal.runtimeClasspath += files(buildDir)
      }
  
      classpath = sourceSets.testLocal.runtimeClasspath
  }
  
  check.dependsOn localTest
  </code></pre>
  
  <p><strong>MyActivityTest.java</strong></p>
  
  <pre><code>@RunWith(RobolectricTestRunner.class)
  @Config(manifest=Config.NONE)
  public class MyActivityTest {
  
      MyActivity activity;
  
  
      @Before
      public void setUp() {
          activity = Robolectric.buildActivity(MyActivity.class).create().get();
      }
  
      @Test
      public void testSomeNumber() {
          Assert.assertEquals(true,true);
      }
  }
  </code></pre>
  
  <p>MyActivity.java extends a BaseActivity which extends ActionBarActivity</p>
  
  <p>Running this configuration from command line calling ./gradlew localTest results in following Exception</p>
  
  <p><strong>Stacktrace</strong></p>
  
  <pre><code>java.lang.NullPointerException
      at org.robolectric.res.builder.RobolectricPackageManager.getActivityInfo(RobolectricPackageManager.java:62)
      at android.support.v7.app.ActionBarActivityDelegate.getUiOptionsFromMetadata(ActionBarActivityDelegate.java:157)
      at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:53)
      at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
      at com.example.activity.BaseActivity.onCreate(BaseActivity.java:17)
      at com.example.activity.MyActivity.onCreate(MyActivity.java:27)
      at android.app.Activity.performCreate(Activity.java:5008)
      at org.fest.reflect.method.Invoker.invoke(Invoker.java:112)
      at org.robolectric.util.ActivityController$1.run(ActivityController.java:119)
      at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:256)
      at org.robolectric.util.ActivityController.create(ActivityController.java:114)
      at org.robolectric.util.ActivityController.create(ActivityController.java:126)
      at com.example.test.MyActivityTest.setUp(MyActivityTest.java:35)
  </code></pre>
  
  <p>Any ideas?</p>