title: Android test cannot find source class
body: <p>I'm trying to configure a android app to run tests with robolectric.
  I'm new to gradle, and I can't find out what the problem is. <br/><br/>
  When I run <strong>./gradlew robolectric</strong> on the command line, I get a cannot find symbol error.</p>
  
  <p>The error I get is:</p>
  
  <pre><code>MainActivityTest.java:18: error: cannot find symbol
          Robolectric.buildActivity(MainActivity.class).get().getResources();
                                    ^
    symbol:   class MainActivity
    location: class MainActivityTest
  </code></pre>
  
  <p>This is my build.gradle file:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'robolectric'
  
  android {
      compileSdkVersion 20
      buildToolsVersion "20.0.0"
  
      defaultConfig {
          applicationId "com.app.id"
          minSdkVersion 16
          targetSdkVersion 20
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              runProguard false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      lintOptions {
          abortOnError false
      }
      sourceSets{
          main.setRoot('src/main')
          androidTest.setRoot('src/test')
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
  
      androidTestCompile 'org.robolectric:robolectric:2.3'
      androidTestCompile 'junit:junit:4.11'
  }
  </code></pre>
  
  <p>So, the problem seems to be that I cannot access the source file when I run the tests, but I couldn't find a way to fix it.</p>
  
  <p>Can anyone tell me what i'm doing wrong?
  Thanks!</p>