title: Generate APK's with different keystores
body: <p>I've created project with different flavors. 
  Each flavor has it's own application id and it's keystore and password.</p>
  
  <p>On gradle file, I added the <code>signingConfigs</code> section to set the <code>keyAlias</code>, <code>keyPassword</code>, <code>storeFile</code> and <code>storePassword</code>.</p>
  
  <p>Next, on <code>release</code> section in <code>buildTypes</code>, I set the signing config for each flavor.</p>
  
  <p>then, I generated all the flavors. I got all the apk's with the correct content and package names..
  but when I tried to upload to play store, I got an error:</p>
  
  <pre><code>Upload failed: You uploaded an APK that is not signed with the upload certificate. 
                 You must use same certificate.
                 The uploaded certificate has fingerprint "A" and the certificate
                 used to sign the APK you uploaded have fingerprint "B".
  </code></pre>
  
  <p>Now, I understand that it used different certificates.. my question is how can I fix it from gradle? 
  So the generating process of the APK's will also distinguish between the different certificate and will use the correct certificate for each flavor?</p>
  
  <p>The gradle file looks like:</p>
  
  <pre><code>android{
  
      signingConfigs {
          flavorA {
              keyAlias flavorAKeystoreProperties['keyAlias']
              keyPassword flavorAKeystoreProperties['keyPassword']
              storeFile file(flavorAKeystoreProperties['storeFile'])
              storePassword flavorAKeystoreProperties['storePassword']
          }
  
          flavorB {
              keyAlias flavorBKeystoreProperties['keyAlias']
              keyPassword flavorBKeystoreProperties['keyPassword']
              storeFile file(flavorBKeystoreProperties['storeFile'])
              storePassword flavorBKeystoreProperties['storePassword']
          }
  
          flavorC{
              keyAlias flavorCKeystoreProperties['keyAlias']
              keyPassword flavorCKeystoreProperties['keyPassword']
              storeFile file(flavorCKeystoreProperties['storeFile'])
              storePassword flavorCKeystoreProperties['storePassword']
          }       
      }
  
  
      flavorDimensions("default")
      productFlavors{
  
          flavorA{
              dimension "default"
              applicationId "com.example.flavor.flavorA"
              signingConfig signingConfigs.flavorAConfig
          }
  
          flavorB{
              dimension "default"
              applicationId "com.example.flavor.flavorB"
              signingConfig signingConfigs.flavorBConfig
          }
  
          flavorC{
              dimension "default"
              applicationId "com.example.flavor.flavorC"
              signingConfig signingConfigs.flavorCConfig
          }
      }   
  
      buildTypes {
          release {
              minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
              productFlavors.flavorA.signingConfig signingConfigs.flavorAConfig
              productFlavors.flavorB.signingConfig signingConfigs.flavorBConfig
              productFlavors.flavorC.signingConfig signingConfigs.flavorCConfig
  
      }
          debug {
              applicationIdSuffix ".debug"
              minifyEnabled false
          }
      }
  }
  </code></pre>