Reni Delonzek
Reni Delonzek

Reputation: 51

Dependency resolved to an incompatible version

I need to use dialogFlow sdk along with firestore sdk. In separate projects I can use normally, but when I join them, a dependency failure occurs

I have tried to use several different versions of them but to no avail

android {
/* Code */
packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/INDEX.LIST'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.google.firebase:firebase-auth:19.0.0'
implementation 'com.google.firebase:firebase-firestore:21.0.0'
//erro aqui
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
//implementation 'com.google.firebase:firebase-inappmessaging-display:19.0.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'

implementation 'ai.api:sdk:2.0.5@aar'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'commons-io:commons-io:2.4'
implementation('ai.api:libai:1.4.8') {
    exclude module: 'log4j-core'
}
implementation 'com.google.dagger:dagger:2.22'
kapt 'com.google.dagger:dagger-compiler:2.16'

implementation 'io.github.dreierf:material-intro-screen:0.0.6'
implementation 'de.hdodenhof:circleimageview:3.0.0'

implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.android.billingclient:billing:2.0.3'

implementation 'com.squareup.retrofit2:retrofit:2.5.0'//rede
implementation 'com.squareup.retrofit2:converter-jackson:2.4.0'
implementation 'com.github.pchmn:MaterialChipsInput:1.0.8'
implementation 'com.github.clans:fab:1.6.4'//floatingActionMenu

implementation 'com.github.ialokim:android-phone-field:0.2.3'
implementation 'com.google.cloud:google-cloud-dialogflow:0.108.0-alpha'
//erro aqui
implementation 'com.squareup.picasso:picasso:2.71828'

implementation 'com.stepstone.apprating:app-rating:2.3.1'

}
apply plugin: 'com.google.gms.google-services' 
googleServices { disableVersionCheck = false }

The error that is displayed in the attempt to compile:

Dependency resolved to an incompatible version: Dependency(fromArtifactVersion=ArtifactVersion(groupId=io.grpc, artifactId=grpc-okhttp, version=1.21.0), toArtifact=Artifact(groupId=io.grpc, artifactId=grpc-core), toArtifactVersionString=[1.21.0])

FAILURE: Build failed with an exception.

Dependency failing: io.grpc:grpc-okhttp:1.21.0 -> io.grpc:grpc-core@[1.21.0], but grpc-core version was 1.23.0.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the artifact with the issue. -- Project 'app' depends onto com.google.firebase:[email protected] -- Project 'app' depends onto com.google.cloud:[email protected]

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dependency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your build.gradle file.

Upvotes: 0

Views: 2822

Answers (1)

Reni Delonzek
Reni Delonzek

Reputation: 51

I was able to solve by adding this to build.gradle

android {
   //
   configurations.all {
    exclude group:'com.google.api.grpc',module:'proto-google-common-protos'
    exclude group: 'com.google.protobuf', module: 'protobuf-java'
    exclude group: 'com.google.guava',module: 'guava-jdk5'
   }
}

The solution and explanation of the problem comes from here

Upvotes: 1

Related Questions