0
votes

All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes).

Found versions 17.1.2, 16.0.5, 16.0.4, 16.0.1, 16.0.0. Examples include com.google.android.gms:play-services-ads-base:17.1.2 and com.google.android.gms:play-services-measurement-base:16.0.5

this the gradle I am using

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "com.hoper.friebasecrashalytics"
        minSdkVersion 14
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.0.2'
    compile "com.android.support:exifinterface:26.0.2"
    compile 'com.android.support:animated-vector-drawable:26.0.2'
    //compile 'com.google.firebase:firebase-core:16.0.5'
    compile  'com.google.android.gms:play-services-ads:17.1.1'
    //compile 'com.crashlytics.sdk.android:crashlytics:2.9.6'
    testCompile 'junit:junit:4.12'
}

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '26.0.2'
            }
        }
    }

}

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

even when we dont use firebase the error occurs

how can we solve this issue

1

1 Answers

0
votes

Check which libraries are shown in the warning and implement them with the same version number. For example:

Warning shows:

com.android.support:customtabs:xx.x.x

You need to implement:

implementation 'com.android.support:customtabs:28.0.0'