title: Android jUnit Test java.lang.NoClassDefFoundError: android/database/sqlite/SQLiteOpenHelper
body: <p>I am trying to run a unit tests which mock a child class of <code>SQLiteOpenHelper</code> but I am getting the following error.</p>
  
  <pre><code>java.lang.NoClassDefFoundError: android/database/sqlite/SQLiteOpenHelper
  
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
      ...
  at org.dfhu.vpodplayer.util.JsonExporterTest.export(JsonExporterTest.java:43)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      ...
  </code></pre>
  
  <p>My Gradle file looks like</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 24
      buildToolsVersion '25.0.1'
      defaultConfig {
          applicationId "org.dfhu.vpodplayer"
          minSdkVersion 18
          targetSdkVersion 24
          versionCode 1
          versionName "1.2"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          targetCompatibility 1.7
          sourceCompatibility 1.7
      }
  }
  
  
  buildscript {
    repositories {
      mavenCentral()
    }
    dependencies {
      classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    }
  }
  
  apply plugin: 'com.neenbedankt.android-apt'
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
          exclude group: 'com.android.support', module: 'support-annotations'
      })
  
      compile 'com.android.support:appcompat-v7:24.2.1'
      compile 'com.android.support:support-v4:24.2.1'
      compile 'com.android.support:recyclerview-v7:24.2.1'
  
      testCompile 'junit:junit:4.12'
      testCompile 'org.powermock:powermock-api-mockito:1.6.5'
      testCompile 'org.powermock:powermock-module-junit4:1.6.5'
  }
  </code></pre>
  
  <p>This did work before I reinstalled, Android Studio and updated to builtToolsVersion '25.0.1'.</p>
  
  <p>I am looking for a way to get my android dependencies in my test runner.</p>