title: Robolectric + Gradle Fails when initialized test
body: <p>I can't execute tests with Robolectric, when I try to execute the tests:</p>
  
  <pre><code>./gradlew test
  </code></pre>
  
  <p>I get the following exception:</p>
  
  <pre><code>com.Makeupalley.test.HomeRobolectricTest &gt; initializationError FAILED
  java.lang.NoClassDefFoundError
      Caused by: java.lang.ClassNotFoundException
  
  java.lang.NoClassDefFoundError: android/app/Activity
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
  .
  .
  .
  Caused by: java.lang.ClassNotFoundException: android.app.Activity
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  </code></pre>
  
  <p>The test fails with any assert like this: <strong>assertTrue(true).</strong></p>
  
  <p>This is my build.gradle: </p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
          maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
      }
       dependencies {
           classpath 'com.android.tools.build:gradle:0.12.+'
           classpath 'org.robolectric:robolectric-gradle-plugin:0.12.+'
  
      }
  }
  
  ...
  
  dependencies {
      compile('junit:junit:4.11') {
          exclude module: 'hamcrest-core'
      }
  
   compile('org.robolectric:robolectric:2.3') {
          exclude module: 'classworlds'
          exclude module: 'commons-logging'
          exclude module: 'httpclient'
          ...
      }    
  }
  </code></pre>
  
  <p>Test File:</p>
  
  <pre><code>@Config(emulateSdk = 18)
  @RunWith(RobolectricTestRunner.class)
  public class HomeRobolectricTest {
      private TestActivity activity;
  
      public HomeRobolectricTest(){}
  
      @Before
      public void setup()  {
          activity = Robolectric.buildActivity(TestActivity.class).create().get();
      }
  
      @Test
      public void testInstanceActivity() throws Exception {
          assertTrue(true);
      }
  
  ...
  }
  </code></pre>
  
  <p>Someone can help me our give me some guidelines?</p>
  
  <p>If you need more information or all build.gradle file, I can post it.</p>
  
  <p>build.gradle file: <a href="https://gist.github.com/anonymous/d0f0bac71a0fb76f8454" rel="noreferrer">https://gist.github.com/anonymous/d0f0bac71a0fb76f8454</a></p>
  
  <p>Thanks</p>
  
  <p><strong>UPDATE - Android section</strong></p>
  
  <pre><code>android {
  
      compileSdkVersion 15
      buildToolsVersion '19.1.0'
  
      defaultConfig {
          minSdkVersion 10
          targetSdkVersion 15
          versionCode 45
          versionName "1.4.210"
          testInstrumentationRunner     "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"
      }
  
      buildTypes {
          release {
              runProguard true
              proguardFile 'proguard-project.txt'
          }
          debug {
              runProguard false
              testCoverageEnabled = true
          }
      }
  
      signingConfigs {
  
      }
  
      packagingOptions {
          exclude 'META-INF/INDEX.LIST'
          exclude 'META-INF/INDEX'
          exclude 'META-INF/LICENSE'
          exclude 'META-INF/LICENSE.txt'
          exclude 'META-INF/NOTICE'
          exclude 'LICENSE.txt'
          exclude 'META-INF/license.txt'
          exclude 'META-INF/notice.txt'
          exclude 'META-INF/ASL2.0'
      }
  
      sourceSets {
          androidTest {
              setRoot('src/test')
          }
      }
  
      lintOptions {
          checkReleaseBuilds false
          abortOnError false
      }
  }
  </code></pre>