0

I am using this dependency in the gradle file:

compile 'com.google.android.gms:play-services:10.2.4'

But I get this error:

All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 8.3.0, 10.2.4. Examples include com.google.android.gms:play-services-measurement:8.3.0 and com.google.android.gms:play-services-ads-lite:10.2.4

But I am not using play-services-measurement. I don't even know what it is. Any idea?

This is my complete gradle file:

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

buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.1' //https://developer.android.com/studio/releases/gradle-plugin.html
        classpath 'com.google.gms:google-services:3.0.0'
    }
}



android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    compileOptions {
        encoding "UTF-8"
    }

    lintOptions {
        disable 'MissingTranslation' 
    }

    defaultConfig {
        applicationId "xx.yy.zz"
        minSdkVersion 9
        targetSdkVersion 23
        versionCode 120
        versionName "1.20"
        multiDexEnabled true  //Enabling multi dex support due to exceeding the 65K methods dex limit imposed by Android: http://stackoverflow.com/questions/29756188/java-finished-with-non-zero-exit-value-2-android-gradle
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            applicationVariants.all { variant ->
                variant.outputs.each { output ->
                    def formattedDate = new Date().format('yyyyMMddHHmmss')
                    def newName = output.outputFile.name
                    newName = newName.replace("app-", "MyAppName") 
                    newName = newName.replace("-release", "-release" + formattedDate)
                    //noinspection GroovyAssignabilityCheck
                    output.outputFile = new File(output.outputFile.parent, newName)
                }
            }
        }

        repositories {
            maven { url 'http://ksoap2-android.googleco/svde.cmomn/2-repo' }
        }
    }
}

//Lates play-services: https://developers.google.com/android/guides/setup
//and https://developers.google.com/android/guides/setup
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:mediarouter-v7:25.3.1'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.google.android.gms:play-services:10.2.4'
    //compile 'com.google.android.gms:play-services-maps:10.2.4'
    //compile 'com.google.android.gms:play-services-ads:10.2.4'
    //compile 'com.google.android.gms:play-services-measurement:10.2.4'

    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile project(':simple-crop-image-lib')
    compile 'com.android.support:cardview-v7:25.3.1'

    //compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.1'
    compile files('libs/ksoap2-android-assembly-2.5.8-jar-with-dependencies.jar')
}
Ton
  • 9,235
  • 15
  • 59
  • 103

0 Answers0