title: Gradle: add dependency for a specific flavour of the library
body: <p>I have a library project and a application. I'd like to have 2 product flavours (<em>store</em>, <em>dev</em>) for both library and application. When I build the <em>store</em> flavour for the application I want to use the <em>store</em> flavour from the library. Also when I build the <em>dev</em> flavour for the application I want to use the <em>dev</em> flavour from the library. I tried setting the same product flavours for both library and application but it does not work.  </p>
  
  <p>Here is my configuration:</p>
  
  <p><em>Library</em></p>
  
  <pre><code>apply plugin: 'android-library'
  
  android {
      compileSdkVersion 19
      buildToolsVersion "19.1.0"
  
      defaultConfig {
          applicationId "ro.amarkovits.graddletest.lib"
          minSdkVersion 14
          targetSdkVersion 19
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              runProguard false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      productFlavors{
          store{
  
          }
          dev{
  
          }
      }
  
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
  }
  </code></pre>
  
  <p>and I have this files:
  src/main/res/values/strings.xml
  and 
  src/store/res/values/strings.xml</p>
  
  <p><em>Application</em></p>
  
  <pre><code>apply plugin: 'android'
  
  android {
      compileSdkVersion 19
      buildToolsVersion '19.1.0'
      defaultConfig {
          applicationId 'ro.amarkovits.mymodule.app'
          minSdkVersion 14
          targetSdkVersion 19
          versionCode 1
          versionName '1.0'
      }
      buildTypes {
          release {
              runProguard false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      productFlavors{
          store{
  
          }
          dev{
  
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile project(':lib')
  }
  </code></pre>
  
  <p>In this situation I get this error: Error:(12, 23) No resource found that matches the given name (at 'text' with value '@string/app_name'). The <em>app_name</em> is defined in <em>string.xml</em> in the library (in both <em>main</em> and <em>store</em> directory)</p>
  
  <p>If I remove the productFlavors from the library it builds but always use the <em>values.xml</em> from the <em>main</em> directory</p>