Kommunicate-io / Kommunicate-Cordova-Ionic-PhoneGap-Chat-Plugin

Kommunicate plugin for Ionic/Phonegap/Cordova
BSD 3-Clause "New" or "Revised" License
21 stars 15 forks source link

In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[18.0. 0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown. #20

Closed rnikitin closed 2 years ago

rnikitin commented 4 years ago

Hi, I'm building new Ionic app. So I decided to try to intergrate Kommunicate and compare it to Intercom.

But after I did all steps I'm getting a build error:

In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[18.0.
0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

This is my app.gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    defaultConfig {
        applicationId "com.drumvox"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 14
        versionName "1.0." + versionCode
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    flatDir{
        dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
    implementation project(':capacitor-android')
    testImplementation "junit:junit:$junitVersion"
    androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
    androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
    implementation project(':capacitor-cordova-android-plugins')
    implementation 'com.google.firebase:firebase-analytics:17.4.3'
    //implementation 'com.google.android.gms:play-services-gcm:17.0.0'
    //implementation 'com.google.android.gms:play-services-auth:18.0.0'
    //implementation 'com.google.android.gms:play-services-analytics:17.0.0'
}

apply from: 'capacitor.build.gradle'

This is my npx cap ls:

  Found 2 Capacitor plugins for android:
    @codetrix-studio/capacitor-google-auth (2.1.1)
    capacitor-intercom (2.1.0)
  Found 16 Cordova plugins for android
    cordova-plugin-androidx (1.0.2)
    cordova-plugin-androidx-adapter (1.1.1)
    cordova-plugin-app-version (0.1.9)
    cordova-plugin-appcenter-analytics (0.5.1)
    cordova-plugin-appcenter-crashes (0.5.1)
    cordova-plugin-appcenter-shared (0.5.1)
    cordova-plugin-cocoapod-support (1.6.2)
    cordova-plugin-firebase-analytics (4.3.0)
    cordova-plugin-ionic (5.4.7)
    cordova-plugin-powermanagement-orig (1.1.2)
    cordova-plugin-screen-orientation (3.0.2)
    cordova-plugin-whitelist (1.3.4)
    cordova-support-android-plugin (1.0.2)
    cordova-support-google-services (1.4.0)
    es6-promise-plugin (4.2.2)
    kommunicate-cordova-plugin (0.4.22)
  Found 2 Capacitor plugins for ios:
    @codetrix-studio/capacitor-google-auth (2.1.1)
    capacitor-intercom (2.1.0)
  Found 11 Cordova plugins for ios
    cordova-plugin-app-version (0.1.9)
    cordova-plugin-appcenter-analytics (0.5.1)
    cordova-plugin-appcenter-crashes (0.5.1)
    cordova-plugin-appcenter-shared (0.5.1)
    cordova-plugin-cocoapod-support (1.6.2)
    cordova-plugin-firebase-analytics (4.3.0)
    cordova-plugin-ionic (5.4.7)
    cordova-plugin-powermanagement-orig (1.1.2)
    cordova-plugin-screen-orientation (3.0.2)
    es6-promise-plugin (4.2.2)
    kommunicate-cordova-plugin (0.4.22)
  Found 5 incompatible Cordova plugins for ios, skipped install
    cordova-plugin-androidx (1.0.2)
    cordova-plugin-androidx-adapter (1.1.1)
    cordova-plugin-whitelist (1.3.4)
    cordova-support-android-plugin (1.0.2)
    cordova-support-google-services (1.4.0)

Is there any know conflicts? Or is there any possible solution? Thanks.

walmon commented 4 years ago

Exactly the same is happening to me. I decided to try Kommunicate instead of Intercom but I'm getting this same error.

walmon commented 4 years ago

This fixed it: https://docs.kommunicate.io/docs/cordova-resolving-errors#android-support-librariesgoogle-versions-conflict

reytum commented 4 years ago

@rnikitin The cordova-plugin-firebase-analytics is fetching the firebase versions at runtime so it is very difficult to tell which version it is using at runtime. You could run ./gradlew command to check the dependencies in the android project. You could also experiment using some versions here: https://docs.kommunicate.io/docs/cordova-resolving-errors#android-support-librariesgoogle-versions-conflict. This should work but you have to find out a common version. @walmon Could you please send the version you used there also the version of cordova-plugin-firebase-analytics you are using.