title: Unresolved reference: test. when adding module for android tests
body: <p>I've started a hello world project in Android Studio.</p>
  <p>I've added <code>test-shared</code> as a module because the files in there need to be seen by <code>test</code> and <code>androidTest</code>.</p>
  <p><a href="https://i.stack.imgur.com/6vP1j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6vP1j.png" alt="enter image description here" /></a></p>
  <p><strong>settings.gradle:</strong></p>
  <pre><code>include ':app'
  include ':test-shared'
  rootProject.name = &quot;My Application&quot;
  </code></pre>
  <p><strong>build.gradle (app level):</strong></p>
  <pre><code>dependencies {
      androidTestImplementation(project(&quot;:test-shared&quot;))
      testImplementation(project(&quot;:test-shared&quot;))
  }
  </code></pre>
  <p><strong>build.gradle (test-shared):</strong></p>
  <pre><code>plugins {
      id 'java-library'
  }
  
  dependencies {
      implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.2&quot;
      implementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3&quot;
      implementation &quot;junit:junit:$junit&quot;
  
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version&quot;
      implementation 'androidx.core:core-ktx:1.3.2'
      testImplementation &quot;junit:junit:$junit&quot;
  }
  </code></pre>
  <p>And within <code>ExampleInstrumentedTest</code> I try to call a method in <code>MainCoroutineRule</code>:</p>
  <pre><code>@RunWith(AndroidJUnit4::class)
  class ExampleInstrumentedTest {
      @Test
      fun useAppContext() {
          MainCoroutineRule().doSomething()
      }
  }
  </code></pre>
  <p>Which gives the error message:</p>
  <p><strong>Unresolved reference: test</strong></p>
  <p>for the test directory, the same result.</p>