title: Gradle Robolectric Resources NotFoundException in Testing
body: <p>I've already knew that this issue has been asked before but I can't solve this problem. 
  I am able to compile and apply test with jUnit, Robolectric and Gradle. The issue or error comes when I try to test an Activity or get a resource. Every time I've got the same issue:</p>
  
  <p><strong>android.content.res.Resources$NotFoundException: unknown resource</strong></p>
  
  <p><strong>Resources$NotFoundException: no such theme</strong> </p>
  
  <pre><code> PageActivity startPageActivity   =   Robolectric.buildActivity(PageActivity.class).create().get();
  
   Context context =  Robolectric.getShadowApplication().getApplicationContext();
   ShadowContext shadowContext = shadowOf(context);
   assertNotNull( " No App name String " ,shadowContext.getString(R.string.app_name) );
  </code></pre>
  
  <p>And this is the project's structure:</p>
  
  <pre><code>.
  ├── build.gradle
  ├── settings.gradle
  └── mainproject
      ├── build
      │   ├── classes
      │   │   └── debug
      ├── build.gradle
      └── src
         └── main
         │    ├── AndroidManifest.xml
         │    └── java
         │         └── com...
         │    └── resources
         └── envDev
         │    └── java
         │         └── com...
         │    └── resources
         └── envQa
         │    └── java
         │          └── com...
         │    └── resources
         └── envLive
         │    └── java
         │         └── com...
         │    └── resources
         └── test
         │    └── src
         │         └── java
         │               └── com...
         │         └── rescources
         └── testEnvDev
         │    └── src
         │         └── java
         │               └── com...
         │         └── rescources
         └── testEnvQa
         │    └── src
         │         └── java
         │               └── com...
         │         └── rescources
         └── testEnvLive
              └── src
                   └── java
                         └── com...
                   └── rescources
  </code></pre>
  
  <p>This is the source set defined in gradle:</p>
  
  <pre><code>sourceSets {  
          main {
              java.srcDir  file('src/main/java')
              manifest.srcFile file('src/main/AndroidManifest.xml')
              res.srcDir file('src/main/resources')
          }
          envDev {
              java.srcDir file('src/envDev/java')
              manifest.srcFile 'src/envDev/AndroidManifest.xml'
              res.srcDir file('src/envDev/resources')
          }
  
          envQa {
              java.srcDir file('src/envQa/java')
              manifest.srcFile 'src/envQa/AndroidManifest.xml'
              res.srcDir file('src/envQa/resources')
          }
  
          envLive {
              java.srcDir file('src/envLive/java')
              manifest.srcFile 'src/envLive/AndroidManifest.xml'
              res.srcDir file('src/envLive/resources')
          }
  
          instrumentTest {
              java.srcDir  file('src/test/java')
              res.srcDir  file('src/test/resources')
          }
          instrumentTestEnvDev {
              java.srcDir file('src/testEnvDev/java')
              res.srcDir file('src/testEnvDev/resources')
          }
          instrumentTestEnvQa {
              java.srcDir file('src/testEnvQa/java')
              res.srcDir file('src/testEnvQa/resources')
          }
          instrumentTestEnvLive {
              java.srcDir file('src/testEnvLive/java')
              res.srcDir file('src/testEnvLive/resources')
          }
  
      }
  </code></pre>
  
  <p>Could someone give a hand to face this problem?</p>
  
  <p>Thanks</p>