title: How to set library version with gradle plugin 3.2?
body: <p>In my android library project I used to do this:</p>
  
  <pre><code>android.libraryVariants.all { variant -&gt;
      def flavourName = variant.productFlavors.get(0).name
      def buildTypeName = variant.buildType.name
  
      def buildVersion = calculateVersion( flavourName, buildTypeName )
      variant.mergedFlavor.versionName = buildVersion
  }
  </code></pre>
  
  <p>And this worked fine up until gradle plugin <code>3.1.3</code>. Now I am trying out <code>3.2.0-beta04</code> (as its much much faster when using vanilla cmake) and I am getting this error:</p>
  
  <pre><code>versionName cannot be set on a mergedFlavor directly.
  versionNameOverride can instead be set for variant outputs using the following syntax:
  android {
      applicationVariants.all { variant -&gt;
          variant.outputs.each { output -&gt;
              output.versionNameOverride = "6.12.0"
          }
      }
  }
  </code></pre>
  
  <p>OK, I apply the suggestion:</p>
  
  <pre><code>android.libraryVariants.all { variant -&gt;
      def flavourName = variant.productFlavors.get(0).name
      def buildTypeName = variant.buildType.name
  
      def buildVersion = calculateVersion( flavourName, buildTypeName )
      variant.outputs.each { output -&gt;
          output.versionNameOverride = buildVersion
      }
  }
  </code></pre>
  
  <p>and now I get this error:</p>
  
  <pre><code> Could not set unknown property 'versionNameOverride' for object of type com.android.build.gradle.internal.api.LibraryVariantOutputImpl.
  </code></pre>
  
  <p>It appears that <code>versionNameOverride</code> property is implemented only for application variants, not for the library variants. Does that mean that support for setting Android AAR version is now deprecated? Or is there another way to achieve that?</p>
  
  <p>EDIT: Note that setting <code>versionName</code> field in <code>defaultConfig</code> section works for my library project - it just does not work setting up programmatically with the method described above.</p>