dialogflow / dialogflow-android-client

Android SDK for Dialogflow
https://dialogflow.com
Apache License 2.0
575 stars 270 forks source link

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

Open naushad97 opened 7 years ago

naushad97 commented 7 years ago

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)
ngreedy commented 6 years ago

same issue ,do u have got an anwser?

naderz commented 6 years ago

Same issue ....

lixuebo0630 commented 6 years ago

Same issue ....

smilelyj commented 6 years ago

Same issue ....

matheusaguiardev commented 6 years ago

Same issue...

PratikPagada commented 6 years ago

imported external model change like as belove :-

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

xrnd commented 6 years ago

Yes, this is the solution. Thanks @PratikPagada

Ganeshk365 commented 6 years ago

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

Bubcho commented 6 years ago

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.

PratikPagada commented 6 years ago

@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')
}
PengJunJun commented 6 years ago

thank you very much. @PratikPagada

Caguillo commented 6 years ago

@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...

dineshswaas commented 6 years ago

Thanks @PratikPagada

PratikPagada commented 6 years ago

Hello @Caguillo

change in the build.gradle file.

dineshswaas commented 6 years ago

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

hariprakash619 commented 6 years ago

Same issues , any fix?

dineshswaas commented 6 years ago

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 notifications@github.com 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 .

PratikPagada commented 6 years ago

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

dineshswaas commented 6 years ago

tel,l Actually what issue you having...

Thanks & Regards Dineshkumar .k

On Mon, Feb 12, 2018 at 2:51 PM, Pratik notifications@github.com 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 .

rohangho commented 6 years ago

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

Thanks

Sunilkashyap commented 6 years ago

what is the solution this error..

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

trevjonez commented 6 years ago

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

IgorGanapolsky commented 5 years ago

I am getting this error:

Cannot choose between the following variants of project

glazey132 commented 5 years ago

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?

wangmeng88525 commented 5 years ago

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

samramez commented 5 years ago

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

hi-dhl commented 5 years ago

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

robotsquidward commented 4 years ago

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

androiddevcoding commented 3 years ago

Fix build variant to implementantion modules

Dalimwale commented 1 year ago

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: