Unable to use sdk dialogFlow java together with firestore - Dependency failing

Asked

Viewed 70 times

0

I need to use the dialogFlow sdk along with the firestore sdk. In separate projects I can use normally, but when I join them, there is a dependency failure. My build.Radle:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'io.fabric'

apply plugin: 'kotlin-kapt'

def dbflow_version = "4.2.4"

android {
compileSdkVersion 28
defaultConfig {
    applicationId "br.com.rd"
    minSdkVersion 18
    targetSdkVersion 28
    versionCode 49
    versionName "4.9"
    multiDexEnabled true
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        manifestPlaceholders = [crashlyticsEnabled: true]
    }
    debug {
        manifestPlaceholders = [crashlyticsEnabled: false]
    }
}
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 "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

implementation 'androidx.vectordrawable:vectordrawable:1.0.0'
configurations {
    all*.exclude group: 'com.android.support', module: 'support-v13'
}
implementation("android.arch.work:work-runtime:1.0.0-alpha11") {
    exclude group: 'com.google.guava', module: 'listenablefuture'
}

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

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'


testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

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 'weekselection.com.library:library:1.0.0'
implementation 'com.google.android:flexbox:1.1.0'

implementation 'com.github.iamrobj:NotificationHelperLibrary:2.0.5'

kapt "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
implementation "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
implementation "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"
implementation "com.github.Raizlabs.DBFlow:dbflow-kotlinextensions:${dbflow_version}"

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 build attempt:

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.

* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[1.21.0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

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.

I have tried to use several different versions of them but no success at all

1 answer

0

I was able to solve it by adding this to the build.Radle

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 come from here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.