title: How to add resources to androidTest for android library in AndroidStudio
body: <p>I made an <code>androidLibrary</code> project which contains some <code>Volley</code> request classes,
  and want to write a unit test for some of these requests. </p>
  
  <p>I have done that like a hundred times, and it works <em>somehow</em> after several tries, but never on the first try. </p>
  
  <p>If I try this via androidStudio </p>
  
  <p>RightClick Project->New->Android Resource Directory </p>
  
  <p>you can choose between sourceSets "main", "debug" and "release". There is no <code>androidTest</code> option.</p>
  
  <p>If I try it manualy, adding the following folders <code>[moduleName]/src/androidTest/res/raw</code>
  and put a file inside (lets say image.jpg), I do not get the reference via <code>R.raw.image</code>. In fact I haven't access to <code>R.raw</code> in my Test at all.</p>
  
  <p>I also tried a Build->rebuild project or Build->clean without success.</p>
  
  <p>In other projects I have a <code>my.app.namespace.R</code> along a <code>my.app.namespace.test.R</code> which holds all test resources. </p>
  
  <p>So my question is: 
  What do I need to do in order to add a <code>res</code> folder to my androidTest, which is accessible via <code>R.[folder].[resId]</code>?</p>
  
  <p>Am I missing a crucial step after adding the files (i.e. telling gradle explicitly about it)?</p>
  
  <p>Because adding a tag like this in my <code>build.gradle</code> also doesn't seem to make any difference:</p>
  
  <pre><code>android {
      sourceSets {
          androidTest {
              java.srcDirs = ['src/androidTest/java']
              res.srcDirs = ['src/androidTest/res']
          }
      }
  }
  </code></pre>
  
  <p>If it matters I am using:</p>
  
  <ul>
  <li>Android Studio 3.1.2</li>
  <li>gradle-wrapper 4.4</li>
  <li>minSdkVersion 19</li>
  <li>targetSdkVersion 27</li>
  </ul>