title: Android: Add library module in particular flavor only
body: <p>In my android application, I have 2 library modules that need to be included conditionally based on flavor. Following is the application structure <br>
      <code>:app</code><br><code>:library1</code><br><code>:library2</code>
  <br>And app has 2 flavors, so it will generate 2 apk's, one free version and another paid. So accordingly configured app build.gradle as follows:<br></p>
  
  <pre><code>android {
      flavorDimensions("billing_type")
      productFlavors {
          free {
              dimension "billing_type"
          }
  
          paid {
              dimension "billing_type"
          }
      }
  }
  dependencies {
      implementation project(path: 'flavor1')
      implementation project(path: 'flavor2')
  }
  </code></pre>
  
  <p>As we can see, both library modules will be included in both flavors(free and paid). But i want to include <strong>library2</strong> only in <strong>paid</strong> flavor. So how can i conditionally add <strong>library2</strong> only in <strong>paid</strong> flavor? I followed some of the approaches mentioned in <a href="https://medium.com/@elye.project/support-flavors-and-buildtypes-across-library-modules-31acf9c6d806" rel="nofollow noreferrer">link</a> </p>
  
  <p>and made following changes: <br></p>
  
  <pre><code>android {
      flavorDimensions("billing_type")
      productFlavors {
          free {
              dimension "billing_type"
          }
  
          paid {
              dimension "billing_type"
          }
      }
  }
  configurations {
      freeImplementation
      paidImplementation
  }
  dependencies {
      freeImplementation implementation project(path: 'flavor1')
      paidImplementation implementation project(path: 'flavor2')
  }
  </code></pre>
  
  <p>All the references online are for older grdale versions which uses <strong>compile</strong> to add library modules, 
   But it has been deprecated since gradle plugin 3.0.0. So can anyone help me figure out how to conditionally add library module in particular flavor only in latest </p>