title: Android buildTypes vs. productFlavors error
body: <p>Decided to switch to from Android gradle plugin 3.5.x to gradle plugin 4.10 with Gradle 6.5 and stuck with mistake.</p>
  <p>Here's my build.gradle</p>
  <pre><code>defaultConfig {
  
      applicationId &quot;com.example.myapp
      targetSdkVersion targetSdkVersionVar
      multiDexEnabled true
  }
  
  flavorDimensions &quot;version&quot;
  
  productFlavors {
      kitkat {
          sourceSets { &quot;src/android/kitkat&quot; }
          dimension &quot;version&quot;
          minSdkVersion minSdkKitkat
          targetSdkVersion targetSdkKitkat
          versionNameSuffix &quot;-kitkat&quot;
      }
      nougat {
          sourceSets { &quot;src/android/nougat&quot; }
          dimension &quot;version&quot;
          minSdkVersion minSdkNougat
          targetSdkVersion targetSdkVersionVar
          versionNameSuffix &quot;-nougat&quot;
      }
  }
  
  
  buildTypes {
  
      debug {
          multiDexKeepFile file('multidex-config.txt')
          multiDexKeepProguard file('multidex-config.pro')
          minifyEnabled false
          zipAlignEnabled true
          sourceSets {
  
              //main.java.srcDirs += 'src/main/kotlin'
              main {
                  java.srcDirs = ['src/android/default/java/', 'src/common/java/']
                  jni.srcDirs = [] //disable ndk support
                  manifest.srcFile 'src/android/default/AndroidManifest.xml'
                  resources.srcDirs = ['src/android/default']
                  aidl.srcDirs = ['src/android/default']
                  renderscript.srcDirs = ['src/android/default']
                  res.srcDirs = ['src/android/default/res']
                  assets.srcDirs = ['src/android/default/assets']
              }
              test {
                  java.srcDirs = ['src/test/java']
              }
              androidTest {
                  java.srcDirs = ['src/androidTest/java']
              }
          }
      }
      release {
          multiDexKeepFile file('multidex-config.txt')
          multiDexKeepProguard file('multidex-config.pro')
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          zipAlignEnabled true
          sourceSets {
  
              main {
                  java.srcDirs = ['src/android/default/java/', 'src/common/java/']
                  jni.srcDirs = [] //disable ndk support
                  manifest.srcFile 'src/android/default/AndroidManifest.xml'
                  resources.srcDirs = ['src/android/default']
                  aidl.srcDirs = ['src/android/default']
                  renderscript.srcDirs = ['src/android/default']
                  res.srcDirs = ['src/android/default/res']
                  assets.srcDirs = ['src/android/default/assets']
              }
              test {
                  java.srcDirs = ['src/test/java']
              }
              androidTest {
                  java.srcDirs = ['src/androidTest/java']
              }
          }
      }
  }
  </code></pre>
  <p>Trying to build I receive following error messages:</p>
  <pre><code>Could not determine the dependencies of task ':app:checkKitkatReleaseLibraries'.
  &gt; Could not resolve all task dependencies for configuration ':app:kitkatReleaseReverseMetadataValues'.
     &gt; Could not resolve project :app.
       Required by:
           project :app
        &gt; The consumer was configured to find a usage of 'android-reverse-meta-data' of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'version' with value 'kitkat'. However we cannot choose between the following variants of project :app:
            - kitkatDebugAndroidTestCompile
            - kitkatDebugAndroidTestRuntime
            - kitkatDebugRuntime
            - kitkatDebugUnitTestCompile
            - kitkatDebugUnitTestRuntime
            - kitkatReleaseRuntime
            - kitkatReleaseUnitTestCompile
            - kitkatReleaseUnitTestRuntime
            - nougatDebugAndroidTestCompile
            - nougatDebugAndroidTestRuntime
            - nougatDebugRuntime
            - nougatDebugUnitTestCompile
            - nougatDebugUnitTestRuntime
            - nougatReleaseRuntime
            - nougatReleaseUnitTestCompile
            - nougatReleaseUnitTestRuntime
          All of them match the consumer attributes:
            - Variant 'kitkatDebugAndroidTestCompile' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'kitkatDebugAndroidTestRuntime' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'kitkatDebugRuntime' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'kitkatDebugUnitTestCompile' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'kitkatDebugUnitTestRuntime' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'kitkatReleaseRuntime' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'kitkatReleaseUnitTestCompile' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'kitkatReleaseUnitTestRuntime' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'nougatDebugAndroidTestCompile' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'nougatDebugAndroidTestRuntime' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'nougatDebugRuntime' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'nougatDebugUnitTestCompile' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'nougatDebugUnitTestRuntime' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'nougatReleaseRuntime' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'nougatReleaseUnitTestCompile' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
            - Variant 'nougatReleaseUnitTestRuntime' capability myapp:app:unspecified:
                - Unmatched attributes:
                    - Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')
                    - Doesn't say anything about its usage (required a usage of 'android-reverse-meta-data')
                    - Provides attribute 'org.jetbrains.kotlin.localToProject' with value 'local to :app' but the consumer didn't ask for it
                    - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but the consumer didn't ask for it
                    - Doesn't say anything about version (required 'kitkat')
          The following variants were also considered but didn't match the requested attributes:
            - Variant 'kitkatDebugApiElements' capability myapp:app:unspecified declares a component, as well as attribute 'version' with value 'kitkat':
                - Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a usage of 'android-reverse-meta-data' of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release'
            - Variant 'kitkatDebugRuntimeElements' capability myapp:app:unspecified declares a component, as well as attribute 'version' with value 'kitkat':
                - Incompatible because this component declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a usage of 'android-reverse-meta-data' of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release'
            - Variant 'kitkatReleaseApiElements' capability myapp:app:unspecified declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'version' with value 'kitkat':
                - Incompatible because this component declares an API of a component and the consumer needed a usage of 'android-reverse-meta-data' of a component
            - Variant 'kitkatReleaseRuntimeElements' capability myapp:app:unspecified declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'version' with value 'kitkat':
                - Incompatible because this component declares a runtime of a component and the consumer needed a usage of 'android-reverse-meta-data' of a component
            - Variant 'nougatDebugApiElements' capability myapp:app:unspecified:
                - Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'version' with value 'nougat' and the consumer needed a usage of 'android-reverse-meta-data' of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'version' with value 'kitkat'
            - Variant 'nougatDebugRuntimeElements' capability myapp:app:unspecified:
                - Incompatible because this component declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'version' with value 'nougat' and the consumer needed a usage of 'android-reverse-meta-data' of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'version' with value 'kitkat'
            - Variant 'nougatReleaseApiElements' capability myapp:app:unspecified declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
                - Incompatible because this component declares an API of a component, as well as attribute 'version' with value 'nougat' and the consumer needed a usage of 'android-reverse-meta-data' of a component, as well as attribute 'version' with value 'kitkat'
            - Variant 'nougatReleaseRuntimeElements' capability myapp:app:unspecified declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release':
                - Incompatible because this component declares a runtime of a component, as well as attribute 'version' with value 'nougat' and the consumer needed a usage of 'android-reverse-meta-data' of a component, as well as attribute 'version' with value 'kitkat'
  </code></pre>
  <p>Before that, when I was using gradle-tools v 3.x - it was working really fine.</p>
  <p>Any thoughts, ideas, hints, clues?</p>