title: Signing product flavors with gradle
body: <p>I am tyring to migrate my projects to gradle. One of my projects has multiple product flavors and each one of them has to be signed with a different <code>signingConfig</code> in its release version. So this is what I tried so far:</p>
  
  <pre><code>buildscript {
      ...
  }
  
  apply plugin: 'android'
  
  android {
      compileSdkVersion 17
      buildToolsVersion '17'
  
      signingConfigs {
          flavor1 {
              storeFile file("keystore")
              storePassword "secret"
              keyAlias "aliasForFlavor1"
              keyPassword "secretFlavor1"
          }
  
          flavor2 {
              storeFile file("keystore")
              storePassword "secret"
              keyAlias "aliasForFlavor2"
              keyPassword "secretFlavor2"
          }
      }
  
      productFlavors {
          flavor1 {
              signingConfig signingConfigs.flavor1
          }
  
          flavor1 {
              signingConfig signingConfigs.flavor2
          }
      }
  }
  
  dependencies {
      ...
  }
  </code></pre>
  
  <p>When I run <code>gradle build</code> I get a <code>groovy.lang.MissingFieldException</code> and the following error message:</p>
  
  <pre><code>No such field: signingConfigs for class: com.android.build.gradle.internal.dsl.GroupableProductFlavorFactory
  </code></pre>
  
  <p>So I assume the <code>productFlavors</code>.* part of the Gradle script is not the right place to put code signing configurations.</p>