title: Unable to build feature modules in a multi-flavor app
body: <p>I am using Gradle 4.4 with Gradle-Android plugin 3.1.1 on Android Studio 3.1.1.</p>
  
  <p>I have 2 flavors 'a' and 'b' and I am unable to build my project due to the following error:</p>
  
  <pre><code>Cannot choose between the following configurations of project :app:
    - aDebugMetadataElements
    - bDebugMetadataElements
  All of them match the consumer attributes:
    - Configuration 'aDebugMetadataElements':
        - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
        - Found com.android.build.api.attributes.VariantAttr 'aDebug' but wasn't required.
        - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Metadata' and found compatible value 'Metadata'.
        - Found dim 'a' but wasn't required.
    - Configuration 'bDebugMetadataElements':
        - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
        - Found com.android.build.api.attributes.VariantAttr 'bDebug' but wasn't required.
        - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Metadata' and found compatible value 'Metadata'.
        - Found dim 'b' but wasn't required.
  </code></pre>
  
  <p><strong>app build.gradle:</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android'
  apply plugin: 'kotlin-android-extensions'
  
  android {
      compileSdkVersion 27
      defaultConfig {
          applicationId "me.xyz.flavors"
          minSdkVersion 19
          targetSdkVersion 27
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          debug{
              testCoverageEnabled true
          }
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
      flavorDimensions "dim"
      productFlavors{
          a{
              dimension "dim"
          }
          b{
              dimension "dim"
          }
  
      }
  
  
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation project(':base')
      implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
      implementation 'com.android.support:appcompat-v7:27.1.1'
      implementation 'com.android.support.constraint:constraint-layout:1.0.2'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.1'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  }
  </code></pre>
  
  <p><strong>base-feature build.gradle:</strong></p>
  
  <pre><code>apply plugin: 'com.android.feature'
  apply plugin: 'kotlin-android'
  apply plugin: 'kotlin-android-extensions'
  android {
      compileSdkVersion 27
      baseFeature true
      defaultConfig {
          minSdkVersion 19
          targetSdkVersion 27
          versionCode 1
          versionName "1.0"
  
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  
      }
  
      buildTypes {
          aDebug {
              testCoverageEnabled true
          }
          bDebug {
              testCoverageEnabled true
          }
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
  }
  
  dependencies {
      application project(':app')
      api 'com.android.support:appcompat-v7:27.1.1'
      api 'com.android.support.constraint:constraint-layout:1.0.2'
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.1'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
      api "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
  }
  </code></pre>
  
  <p>I have tried the following solutions thus far with no luck:</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/47105383/as-3-0-test-only-module-cannot-choose-between-the-following-configurations-of-pr">AS 3.0 test-only module Cannot choose between the following configurations of project :abcMobile:</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/47989894/single-flavor-module-based-on-multi-flavor-library-in-gradle">Single flavor module based on multi flavor library in Gradle</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/44390590/android-studio-3-0-error-migrate-dependency-configurations-for-local-modules">Android Studio 3.0 Error. Migrate dependency configurations for local modules</a></p></li>
  </ul>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>Based on the comments and one answer, I tried giving a different <code>applicationIdSuffix</code> to both flavors, but the problem persists:</p>
  
  <pre><code>productFlavors{
          a{
              applicationIdSuffix ".a"
              dimension "dim"
          }
          b{
              applicationIdSuffix ".b"
              dimension "dim"
          }
  
      }
  </code></pre>