title: Testing Room Migration. Cannot find the schema file in the assets folder
body: <p><strong>My build.gradle file, I'm using kapt rather than java's annotation processor</strong></p>
  <pre><code> defaultConfig {
          ...
          kapt {
              arguments {
                  arg(&quot;room.schemaLocation&quot;, &quot;$projectDir/schemas&quot;.toString())
              }
          }
  
  
      }
      sourceSets {
  
          androidTest.assets.srcDirs += files(&quot;$projectDir/schemas&quot;.toString())
      }
  </code></pre>
  <p><strong>My RoomDatase base class with the exportSchema set to true</strong></p>
  <pre><code>
  @Database(entities = [DB_Open::class],version = 4, exportSchema = true)
  
  </code></pre>
  <p><strong>The database scheme get's exported and saved as a json file</strong>
  [1]: <a href="https://i.stack.imgur.com/r3Iew.png" rel="nofollow noreferrer">https://i.stack.imgur.com/r3Iew.png</a></p>
  <p><strong>But I still get this error for my migration tests</strong></p>
  <pre><code>java.io.FileNotFoundException: Cannot find the schema file in the assets folder. Make sure to include the exported json schemas in your test assert inputs. See https://developer.android.com/training/data-storage/room/migrating-db-versions#export-schema for details. Missing file: com.crop2cash.gather.data.GatherDatabase/1.json
  at androidx.room.testing.MigrationTestHelper.loadSchema(MigrationTestHelper.java:320)
  at androidx.room.testing.MigrationTestHelper.createDatabase(MigrationTestHelper.java:152)
  at com.crop2cash.gather.MigrationsTest.migrate1to2(MigrationsTest.kt:29)
  at java.lang.reflect.Method.invoke(Native Method)
  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
  at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
  at org.junit.rules.RunRules.evaluate(RunRules.java:20)
  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:104)
  at org.junit.runners.Suite.runChild(Suite.java:128)
  at org.junit.runners.Suite.runChild(Suite.java:27)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
  at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
  at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
  at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:392)
  at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2189)
  </code></pre>
  <p><strong>I have tried all the stackoverflow solutions here like:</strong></p>
  <pre><code>sourceSets {
  
          getByName(&quot;debug&quot;).assets.srcDirs(files(projectDir, &quot;schemas&quot;))
      }
  </code></pre>
  <pre><code>
      sourceSets {
  
  
          getByName(&quot;androidTest&quot;) {
              assets.srcDirs(files(projectDir, &quot;schemas&quot;))
          }
      }
  </code></pre>