title: Android studio - release APK for flavor
body: <p>I'm new to Android Studio and running a debug build on a device is working fine, however to test in app purchasing (and obviously to release) I need a release build signed with the normal key.  I can make an APK using Build -> Generate signed APK, however the package name seems to be incorrect.  Here's my build file:</p>
  
  <pre><code>apply plugin: 'android'
  
  android {
      compileSdkVersion 19
      buildToolsVersion "19.0.1"
  
      defaultConfig {
          minSdkVersion 8
          targetSdkVersion 9
  
          testPackageName "com.company.common.common"
          testInstrumentationRunner "android.common.InstrumentationTestRunner"
      }
  
      signingConfigs {
          releaseConfig {
              storeFile file("filname")
              storePassword "password"
              keyAlias "alias"
              keyPassword "password"
          }
      }
  
      buildTypes {
          debug {
              packageNameSuffix ".debug"
          }
          release {
              runProguard false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
              signingConfig signingConfigs.releaseConfig
          }
      }
  
      productFlavors {
          Flavor1 {
              packageName "com.company.test"
          }
      }
  }
  
  dependencies {
      // some dependencies
  }
  </code></pre>
  
  <p>Note the package name overridden in the flavor.  That flavor has no manifest; the only manifest is under main, and specifies a package of com.company.common.  If I use Android to create a com.company.test APK and install it on a device, then generate an APK from Android Studio and install it, I end up with two apps on the device rather than the second replacing the first.  This indicates that the package names are different, I assume because Android Studio is producing an APK with a package of com.company.common.  Not sure how to verify that though.</p>
  
  <p>When I just build the project, I get a debug APK but no release APK.  How do I get a release APK with the correct package name?  I just ran the app from Android Studio and it says it's installing com.company.test.debug, and that it needs to uninstall the app before installing.  So now I'm thinking the generate signed APK generated a build with the debug package.</p>
  
  <p>So far this is the issue that's preventing me from moving to Android Studio and gradle.  Once I get past this I think I'm clear to move everything over so I'm hoping someone can help me figure it out!</p>