title: Android Studio 2.2 update: aligned APK (zipAlign) not generated using the new Gradle Plugin 2.2.0
body: <p>After updating Android Studio to version 2.2 I also got an update for the Gradle Plugin (it was 2.1.3):</p>
  
  <pre><code>...
  classpath 'com.android.tools.build:gradle:2.2.0'
  ...
  </code></pre>
  
  <p>I see the unaligned variant APK file but other variants are not generated anymore. I tryed to enable the zip align:</p>
  
  <pre><code>buildTypes {
          release {
              minifyEnabled false
              zipAlignEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
              signingConfig signingConfigs.release
          }
          debug {
              applicationIdSuffix '.debug'
          }
  }  
  </code></pre>
  
  <p>but nothing changes. Any ideas?</p>
  
  <p>I "solved" turning back to </p>
  
  <pre><code>classpath 'com.android.tools.build:gradle:2.1.3'
  </code></pre>
  
  <p>in the project level <code>build.gradle</code>.</p>
  
  <p><strong>EDIT (20160922):</strong></p>
  
  <p><strong>Thanks to Fayder Florez</strong> for his response. It's correct, the build environment now produce only one apk (<a href="https://code.google.com/p/android/issues/detail?id=212591" rel="noreferrer">https://code.google.com/p/android/issues/detail?id=212591</a>).</p>
  
  <p>But using by code (that rename de output file name using <code>VERSION CODE</code> and <code>VERSION NAME</code>):</p>
  
  <pre><code>android.applicationVariants.all { variant -&gt;
      variant.outputs.each { output -&gt;
          def padVersionCode = variant.versionCode.toString();
          padVersionCode = padVersionCode.padLeft(5, '0')
          def newApkName = "${output.baseName}_${padVersionCode}-${variant.versionName}"
  
          if (!output.zipAlign)
              newApkName = newApkName + "_unaligned"
  
          newApkName = newApkName + ".apk"
          output.outputFile = new File(output.outputFile.parent, newApkName)
      }
  }
  </code></pre>
  
  <p>I get the "_unaligned" appended to the output file name, so I suppose that <code>output.zipAlign</code> is <code>false</code>.</p>
  
  <p>So is the output file really aligned?</p>
  
  <p><strong>EDIT (20161013)</strong></p>
  
  <p><strong>Thanks to ending0421</strong> and it's suggestion to check the apk using the build tool:</p>
  
  <blockquote>
    <p>zipalign -c -v 4 path/fileName</p>
  </blockquote>
  
  <p>Now <strong>I now that the APK is generated correctly</strong> and the zipalign command syays:</p>
  
  <blockquote>
    <p>Verification succesful</p>
  </blockquote>