2

I created test-only module for android UI tests. It worked find with AS2.3 but when I upgraded to AS3.0 I see below issue:

>Cannot choose between the following:
configurations of project :abcMobile:
 - normalDebugApiElements
 - xxxDebugApiElements
 - yyyDebugApiElements
 - zzzDebugApiElements
All of them match the consumer attributes:
 - Configuration 'normalDebugApiElements':
     - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
     - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Apk' and found compatible value 'Apk'.
     - Found com.android.build.gradle.internal.dependency.VariantAttr 'normalDebug' but wasn't required.
     - Found market 'normal' but wasn't required.
     - Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'.
 - Configuration 'xxxDebugApiElements':........

Here are gradle snippets from test-only module: android { compileSdkVersion project.ext.compileSdkVersion targetProjectPath ':abcMobile' targetVariant 'normalDebug'

defaultConfig {
    applicationId "com.abc.mobile.functional.tests"
    minSdkVersion project.ext.ebayMinSdkVersion
    targetSdkVersion project.ext.ebayTargetSdkVersion
    multiDexEnabled true
} 
buildTypes {
    debug {........
           .....
    }
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

dependencies {
implementation project(':xyz')

implementation group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
....
....
....
....
}
kaur
  • 41
  • 4

1 Answers1

2

This was resolved by adding missingDimensionStrategy '< flavorDimensions>', '< productFlavors>' under defaultConfig {}

For more detail refer to:https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#flavor_dimensions

kaur
  • 41
  • 4