所有android支持库必须使用相同的版本规范

所有android支持库必须使用相同的版本规范,android,gradle,android-support-library,Android,Gradle,Android Support Library,我不知道我哪里出错了,但这让我一直在说 All com.android.support libraries must use the same exact version specification (mixing versions can lead to runtime crashes.) Found versions 24.0.0,23.2.0 Examples include com.android.support:animated-vector-drawable:24.0.0 and c

我不知道我哪里出错了,但这让我一直在说

All com.android.support libraries must use the same exact version specification (mixing versions can lead to runtime crashes.) Found versions 24.0.0,23.2.0 Examples include com.android.support:animated-vector-drawable:24.0.0 and com.android.support:cardview-v7:23.2.0
我的身材,格雷德尔是

        apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '25.0.0'

    defaultConfig {
        applicationId "com.example.project"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

allprojects {
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.parse:parse-android:1.+'
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'com.android.support:design:23.2.0'
    compile 'com.android.support:recyclerview-v7:23.2.0'
    compile 'com.android.support:cardview-v7:23.2.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.mani:ThinDownloadManager:1.2.2'
    compile 'net.rdrei.android.dirchooser:library:3.2@aar'
    compile 'com.google.android.gms:play-services:10.2.0'
    compile 'com.onesignal:OneSignal:3.+@aar'

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

我也尝试将CompileSDK版本更改为24,但到目前为止似乎没有任何效果。实际上,在我引入play services库之前,一切都很正常。

此依赖项使用的是com.android的24.0.0版本。支持:动画矢量绘图:

compile 'com.google.android.gms:play-services:10.2.0'
这将导致android studio抱怨它可能会导致错误/崩溃,因为您的所有google库的版本都不匹配

所以你有两个选择:(我从头顶上就知道了)

  • 将您的
    compileSdkVersion
    更改为24,并将所有支持库依赖项更改为24,以匹配play services依赖项:

    compile 'com.android.support:appcompat-v7:24.0.0'
    compile 'com.android.support:design:24.0.0'
    compile 'com.android.support:recyclerview-v7:24.0.0'
    compile 'com.android.support:cardview-v7:24.0.0'
    
  • com.google.android.gms:play services
    降级至9.4或9.2.1,这样它就不会使用任何版本的24。这仍然需要对您的支持库进行微小的更改,从23.2.0更改为23.0.0

    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.android.support:design:23.0.0'
    compile 'com.android.support:recyclerview-v7:23.0.0'
    compile 'com.android.support:cardview-v7:23.0.0'
    compile 'com.google.android.gms:play-services:9.4.0'
    

  • 你的编译Sdk版本是什么?发布完整的gradleHi@rafsanahmad007,我已经编辑了这篇文章。感谢您的一个或多个依赖项正在请求Android支持库的部分内容,并且正在请求该库的不同版本。您需要跟踪哪个依赖项(例如,通过Gradle dependency report),然后解决问题(例如,通过为请求更新版本的可传递依赖项添加自己的
    compile
    行)。
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.android.support:design:23.0.0'
    compile 'com.android.support:recyclerview-v7:23.0.0'
    compile 'com.android.support:cardview-v7:23.0.0'
    compile 'com.google.android.gms:play-services:9.4.0'