dialogflow-android-client: Gradle sync failed: Cannot choose between the following configurations of project :ailib:
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)
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 30
imported external model change like as belove :-
compile project(‘:linkedin-sdk’) to compile project(path: ‘:linkedin-sdk’, configuration: ‘default’)
same issue ,do u have got an anwser?
Even better, replace the now deprecated
compileconfiguration withimplementationorapi, like this:compile project(':linkedin-sdk')becomesimplementation project(':linkedin-sdk')See this for reference.
@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
Thank you pratikpagada its works , i just like to know why we putting configuration: ‘default’
for AndroidStudio 3.0+, mainMoudle has buildTypes and buildTypes as same as libModule buildTypes and buildTypes ,it would like:
mainModule
libModule:
or you can use matchingFallbacks solve this click
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?
Yes, this is the solution. Thanks @PratikPagada
thank you very much. @PratikPagada
Hi, Can anybody tell me why this error? While importing LinkedIn-SDK
Thanks
Thanks @PratikPagada