title: How to specify android assembled library file name on gradle 5.1
body: <p>Gradle changed it's behavior when I updated from 5.0 to 5.1. </p>
  
  <p>Lets assume that we have an android project with single module named <strong>library</strong>.
  On Gradle 5.0 (and previous versions) when I executed <code>./gradlew assembleRelease</code> or <code>./gradlew assembleDebug</code> generated output was <code>library-release.aar</code> or <code>library-debug.aar</code> respectively.</p>
  
  <p>After I updated to Gradle 5.1 (I also tried 5.1.1) it generates only <code>library.aar</code> for any build type without any build-type classifier in output file name.</p>
  
  <p>So my question is: how can I force Gradle 5.1 to set correct output file naming for different build types like it was before? Below is my library module's build.gradle.kts, but I doesn't think that there is something wrong with it:</p>
  
  <pre><code>import org.jetbrains.kotlin.config.KotlinCompilerVersion
  
  plugins {
      id("com.android.library")
      id("kotlin-android")
      id("maven-publish")
  }
  
  val libraryVersion = "1.5.0"
  
  android {
      compileSdkVersion(28)
  
      defaultConfig {
          minSdkVersion(16)
          targetSdkVersion(28)
          versionCode = 1
          versionName = libraryVersion
      }
  
      lintOptions {
          isAbortOnError = false
      }
  
      buildTypes {
          getByName("release") {
              isMinifyEnabled = false
              proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
          }
      }
  }
  
  dependencies {
      implementation(fileTree(mapOf("include" to listOf("*.jar"), "dir" to "libs")))
      implementation(kotlin("stdlib-jdk7", KotlinCompilerVersion.VERSION))
  }
  </code></pre>
  
  <hr>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>If I add a following code to build.gradle.kts:</p>
  
  <pre><code>afterEvaluate {
      android.libraryVariants.forEach { libraryVariant -&gt;
          libraryVariant.outputs.forEach { output -&gt;
              println(output.outputFile.name)
          }
      }
  }
  </code></pre>
  
  <p>It will print: </p>
  
  <pre><code>library-debug.aar
  library-release.aar
  </code></pre>
  
  <p>Now it starts looking like a bug in gradle 5.1</p>