title: Room database instrumentation test with proguard fails
body: <p>I have this test:</p>
  
  <pre><code>@RunWith(AndroidJUnit4.class)
  public class TestDataDaoTest {
  
      private ApplicationDatabase dataBase;
      private TestDataDao testDataDao;
  
      @Before
      public void initDb() {
          dataBase = Room.inMemoryDatabaseBuilder(InstrumentationRegistry.getContext(),
                  ApplicationDatabase.class)
                  // allowing main thread queries, just for testing
                  .allowMainThreadQueries()
                  .build();
          testDataDao = dataBase.testDataDao();
      }
  
      @After
      public void tearDown() {
          dataBase.close();
      }
  
      @Test
      public void someTest() {
  
      }
  }
  </code></pre>
  
  <p>when i run this test i get that <code>NoSuchMethodError</code> exception:</p>
  
  <pre><code>java.lang.NoSuchMethodError: No virtual method close()V in class Lcom/example/example/database/ApplicationDatabase; or its super classes (declaration of 'com.example.example.database.ApplicationDatabase' appears in /data/app/com.example.exampleModule-2/base.apk)
  at com.example.example.database.dao.TestDataDaoTest.tearDown(Unknown Source)
  at java.lang.reflect.Method.invoke(Native Method)
  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Unknown Source)
  at org.junit.internal.runners.model.ReflectiveCallable.run(Unknown Source)
  at org.junit.runners.model.FrameworkMethod.invokeExplosively(Unknown Source)
  at android.support.test.internal.runner.junit4.statement.RunAfters.evaluate(Unknown Source)
  at org.junit.runners.ParentRunner.runLeaf(Unknown Source)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(Unknown Source)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(Unknown Source)
  at org.junit.runners.ParentRunner$3.run(Unknown Source)
  at org.junit.runners.ParentRunner$1.schedule(Unknown Source)
  at org.junit.runners.ParentRunner.runChildren(Unknown Source)
  at org.junit.runners.ParentRunner.access$000(Unknown Source)
  at org.junit.runners.ParentRunner$2.evaluate(Unknown Source)
  at org.junit.runners.ParentRunner.run(Unknown Source)
  at android.support.test.runner.AndroidJUnit4.run(Unknown Source)
  at org.junit.runners.Suite.runChild(Unknown Source)
  at org.junit.runners.Suite.runChild(Unknown Source)
  at org.junit.runners.ParentRunner$3.run(Unknown Source)
  at org.junit.runners.ParentRunner$1.schedule(Unknown Source)
  at org.junit.runners.ParentRunner.runChildren(Unknown Source)
  at org.junit.runners.ParentRunner.access$000(Unknown Source)
  at org.junit.runners.ParentRunner$2.evaluate(Unknown Source)
  at org.junit.runners.ParentRunner.run(Unknown Source)
  at org.junit.runner.JUnitCore.run(Unknown Source)
  at org.junit.runner.JUnitCore.run(Unknown Source)
  at android.support.test.internal.runner.TestExecutor.execute(Unknown Source)
  at android.support.test.runner.AndroidJUnitRunner.onStart(Unknown Source)
  at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1886)
  </code></pre>
  
  <p>I think it's related to proguard so this is my proguard configuration:</p>
  
  <p>gradle:</p>
  
  <pre><code>    buildTypes {
          debug {
              minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
              testProguardFile 'proguard-test-rules.pro'
              proguardFile 'proguard-project.txt'
          }
  }
  </code></pre>
  
  <p>proguard-test-rules.pro:</p>
  
  <pre><code>    # Proguard rules that are applied to your test apk/code.
  -ignorewarnings
  
  -keepattributes *Annotation*
  
  -dontnote junit.framework.**
  -dontnote junit.runner.**
  
  -dontwarn android.test.**
  -dontwarn android.support.test.**
  -dontwarn org.junit.**
  -dontwarn org.hamcrest.**
  -dontwarn com.squareup.javawriter.JavaWriter
  
  -keepclassmembers class android.arch.** { *; }
  -keep class android.arch.** { *; }
  # Uncomment this if you use Mockito
  #-dontwarn org.mockito.**
  </code></pre>
  
  <p>proguard-project.txt:</p>
  
  <pre><code>-keep class com.fasterxml.jackson.databind.ObjectMapper {
      public &lt;methods&gt;;
      protected &lt;methods&gt;;
  }
  -keep class com.fasterxml.jackson.databind.ObjectWriter {
      public ** writeValueAsString(**);
  }
  -keepnames class com.fasterxml.jackson.** { *; }
  -dontwarn com.fasterxml.jackson.databind.**
  -dontwarn com.flurry.**
  -dontwarn javax.**
  
  -dontwarn okhttp3.**
  -dontwarn okio.**
  -dontwarn javax.annotation.**
  -keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
  -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
  -dontwarn org.joda.convert.**
  
  -dontobfuscate
  -keep public class * extends android.app.Activity
  -keep public class * extends android.app.Application
  -keepattributes *Annotation*
  -keepclassmembers class * {
      @org.greenrobot.eventbus.Subscribe *;
  }
  </code></pre>
  
  <p>removing proguard &amp; minify from debug build is not possible. <br>
  any ideas? <br>
  thanks!</p>