title: error: cannot find symbol in Android gradle library module unit test
body: <p>I have a test project in IntelliJ (using the Android Studio plugin) and I'm trying to set up unit tests as described <a href="http://tools.android.com/tech-docs/unit-testing-support" rel="noreferrer">here</a>.</p>
  
  <p>When running a junit test the project can't seem to find my sources under src > main > java. The following test</p>
  
  <pre><code>package io.adaptiv.plzwrk.lib;
  
  import junit.framework.TestCase;
  import org.junit.Test;
  
  public class AdaptivTest extends TestCase {
  
      @Test
      public void testDoStuff() throws Exception {
          assertEquals(42, Adaptiv.doStuff());
      }
  }
  </code></pre>
  
  <p>gives the error</p>
  
  <pre><code>error: cannot find symbol
          assertEquals(42, Adaptiv.doStuff());
                           ^
    symbol:   variable Adaptiv
    location: class AdaptivTest
  </code></pre>
  
  <p>My 'test' class</p>
  
  <pre><code>package io.adaptiv.plzwrk.lib;
  
  public class Adaptiv {
  
      public static int doStuff() {
          return 42;
      }
  
  }
  </code></pre>
  
  <p>The layout of my project looks like this</p>
  
  <p><img src="https://i.stack.imgur.com/uXdpa.png" alt="project layout"></p>
  
  <p>With settings.gradle</p>
  
  <pre><code>include ':lib'
  </code></pre>
  
  <p>The project build.gradle file</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:1.1.1'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  </code></pre>
  
  <p>The build.gradle under the lib dir</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:1.1.1'
      }
  }
  apply plugin: 'com.android.library'
  
  repositories {
      jcenter()
  }
  
  android {
      compileSdkVersion 22
      buildToolsVersion "22.0.1"
  
      defaultConfig {
          minSdkVersion 9
          targetSdkVersion 22
          versionCode 1
          versionName "1.0"
      }
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_6
          targetCompatibility JavaVersion.VERSION_1_6
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      testCompile 'junit:junit:4.12'
      testCompile "org.mockito:mockito-core:1.9.5"
  }
  </code></pre>