AndroidStudio Gradle“;库必须使用完全相同的版本;

AndroidStudio Gradle“;库必须使用完全相同的版本;,android,android-studio,android-gradle-plugin,google-play-services,Android,Android Studio,Android Gradle Plugin,Google Play Services,我在gradle文件中使用此依赖项: compile 'com.google.android.gms:play-services:10.2.4' apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' buildscript { repositories { mavenCentral() maven { url 'https://oss

我在gradle文件中使用此依赖项:

compile 'com.google.android.gms:play-services:10.2.4'
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')
}
但我得到了这个错误:

所有com.google.android.gms库必须使用完全相同的版本 规范(混合版本可能导致运行时崩溃)。建立 版本8.3.0、10.2.4。例子包括
com.google.android.gms:play services测量:8.3.0
com.google.android.gms:play-services-ads-lite:10.2.4

但我没有使用游戏服务度量。我甚至不知道那是什么。有什么想法吗

这是我完整的gradle文件:

compile 'com.google.android.gms:play-services:10.2.4'
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')
}

用这个。好的,答案是,在某个地方有一个可传递的依赖项。可能在jar文件中,或者在另外两个图像库中。什么是“可传递依赖性”,我如何解决这个问题?其他库依赖的库。见第一条评论