dialogflow-android-client icon indicating copy to clipboard operation
dialogflow-android-client copied to clipboard

Gradle sync failed: Cannot choose between the following configurations of project :ailib:

Open naushad97 opened this issue 8 years ago • 30 comments

Build is failing for Android Client in Android Studio 3.0. Beta 2.

Gradle sync failed: Cannot choose between the following configurations of project :ailib:
				- debugApiElements
				- debugRuntimeElements
				- releaseApiElements
				- releaseRuntimeElements
				All of them match the consumer attributes:
				- Configuration 'debugApiElements':
				- Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
				- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
				- Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
				- Found org.gradle.api.attributes.Usage 'java-api' but wasn't required.
				- Configuration 'debugRuntimeElements':
				- Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
				- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
				- Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
				- Found ... (show balloon)

naushad97 avatar Aug 13 '17 00:08 naushad97

same issue ,do u have got an anwser?

ngreedy avatar Oct 17 '17 02:10 ngreedy

Same issue ....

naderz avatar Oct 30 '17 01:10 naderz

Same issue ....

lixuebo0630 avatar Oct 30 '17 02:10 lixuebo0630

Same issue ....

smilelyj avatar Nov 01 '17 18:11 smilelyj

Same issue...

matheusaguiardev avatar Nov 01 '17 21:11 matheusaguiardev

imported external model change like as belove :-

compile project(':linkedin-sdk') to compile project(path: ':linkedin-sdk', configuration: 'default')

PratikPagada avatar Nov 02 '17 06:11 PratikPagada

Yes, this is the solution. Thanks @PratikPagada

xrnd avatar Nov 03 '17 10:11 xrnd

Thank you pratikpagada its works , i just like to know why we putting configuration: 'default'

Ganeshk365 avatar Nov 15 '17 11:11 Ganeshk365

Even better, replace the now deprecated compile configuration with implementation or api, like this: compile project(':linkedin-sdk') becomes implementation project(':linkedin-sdk')

See this for reference.

Bubcho avatar Nov 16 '17 10:11 Bubcho

@Ganeshk365 If you're using Android plugin for Gradle 3.0.0 or higher, the plugin automatically matches each variant of your app with corresponding variants of its local library module dependencies for you. That is, you should no longer target specific variants of local module dependencies, show as below

dependencies {
  // Adds the 'debug' varaint of the library to the debug varaint of the app
  debugCompile project(path: ':my-library-module', configuration: 'debug')

  // Adds the 'release' varaint of the library to the release varaint of the app
  releaseCompile project(path: ':my-library-module', configuration: 'release')
}

PratikPagada avatar Nov 17 '17 07:11 PratikPagada

thank you very much. @PratikPagada

PengJunJun avatar Nov 23 '17 03:11 PengJunJun

@PratikPagada

Hi, I am stuck.. where to change this solution / in which file?

compile project(':linkedin-sdk') to compile project(path: ':linkedin-sdk', configuration: 'default')

thanks...

Caguillo avatar Dec 16 '17 16:12 Caguillo

Thanks @PratikPagada

dineshswaas avatar Feb 12 '18 04:02 dineshswaas

Hello @Caguillo

change in the build.gradle file.

PratikPagada avatar Feb 12 '18 05:02 PratikPagada

i facing this issue after changed- Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead. @PratikPagada

dineshswaas avatar Feb 12 '18 05:02 dineshswaas

Same issues , any fix?

hariprakash619 avatar Feb 12 '18 09:02 hariprakash619

compile project(':linkedin-sdk') to compile project(path: ':linkedin-sdk', configuration: 'default')

its works fine...

Thanks & Regards Dineshkumar .k

On Mon, Feb 12, 2018 at 2:43 PM, hariprakash619 [email protected] wrote:

Same issues , any fix?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dialogflow/dialogflow-android-client/issues/57#issuecomment-364865488, or mute the thread https://github.com/notifications/unsubscribe-auth/APiMBCNcvcwbhapc9CNrC_cZfn7j0BrSks5tUADVgaJpZM4O1jcV .

dineshswaas avatar Feb 12 '18 09:02 dineshswaas

@dineshswaas show me you project level build.gradle file and app level build.gredle file.

PratikPagada avatar Feb 12 '18 09:02 PratikPagada

tel,l Actually what issue you having...

Thanks & Regards Dineshkumar .k

On Mon, Feb 12, 2018 at 2:51 PM, Pratik [email protected] wrote:

@dineshswaas https://github.com/dineshswaas show me you project level build.gradle file and app level build.gredle file.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dialogflow/dialogflow-android-client/issues/57#issuecomment-364867040, or mute the thread https://github.com/notifications/unsubscribe-auth/APiMBMH_ovBV-HBGwrVp2lft52GqAU3fks5tUAJ_gaJpZM4O1jcV .

dineshswaas avatar Feb 12 '18 09:02 dineshswaas

Hi, Can anybody tell me why this error? While importing LinkedIn-SDK 121

Thanks

rohangho avatar Feb 24 '18 15:02 rohangho

what is the solution this error..

Project with path ':linkedin-sdk' could not be found in root project 'CollegeApp'.

Sunilkashyap avatar Jun 22 '18 01:06 Sunilkashyap

https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration#variant_aware

trevjonez avatar Aug 08 '18 23:08 trevjonez

I am getting this error:

Cannot choose between the following variants of project

IgorGanapolsky avatar Dec 13 '18 21:12 IgorGanapolsky

I had a similar issue until I changed how my app was importing the library that has build variants / product flavors.

The import now looks like this: implementation project(path: ':library-sdk', configuration: 'default')

That resolved the 'cannot choose between the following variants of project' error but now, my app is unable to resolve dependencies loaded from the library. -_-

@PratikPagada are you familiar at all with what could be going wrong?

glazey132 avatar Jan 11 '19 01:01 glazey132

@glazey132 ,I had the same issue ,do you have got an anwser?

wangmeng88525 avatar Jan 21 '19 09:01 wangmeng88525

I have the same issue as @glazey132 and @wangmeng88525 Were you guys able to fix this?

samramez avatar Feb 05 '19 15:02 samramez

for AndroidStudio 3.0+, mainMoudle has buildTypes and buildTypes as same as libModule buildTypes and buildTypes ,it would like:

mainModule

buildTypes {
    release {
        buildConfigField "boolean", "LOG_DEBUG", "false"
        zipAlignEnabled true
        shrinkResources true
        minifyEnabled true
        proguardFiles 'proguard-rules.pro'
    }

    debug {
        buildConfigField "boolean", "LOG_DEBUG", "true"
        zipAlignEnabled true
        shrinkResources false
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

    debug2{

    }
}

libModule:

buildTypes {
    release {

    }

    debug {

    }

    debug2{

    }
}

or you can use matchingFallbacks solve this click

hi-dhl avatar Feb 13 '19 15:02 hi-dhl

For some reason @hi-dhl's link didn't work for me, but this one does explain the use of matchingFallbacks https://developer.android.com/studio/build/dependencies#resolve_matching_errors

robotsquidward avatar Feb 19 '20 20:02 robotsquidward

Fix build variant to implementantion modules

androiddevcoding avatar Nov 09 '20 11:11 androiddevcoding

Am using version 3.0.0 and when I try running my project it brings

One or more issues found when checking AAR metadata values:

Dalimwale avatar Mar 14 '23 13:03 Dalimwale