所有com.android.support库必须使用完全相同的版本规范gradle问题

时间:2017-04-13 09:58:41

标签: android android-studio gradle build.gradle

我遇到问题当我尝试同步我的gradle文件时,所有com.android.support库必须使用完全相同的版本规范。任何人都可以告诉我解决问题的方法。我已经完成了这个解决方案All com.android.support libraries must use the exact same version specification。但不幸的是,它不适用于我的情况。以下是我的傻瓜。

apply plugin: 'com.android.application'


android {
compileSdkVersion 23
buildToolsVersion "25.0.0"
defaultConfig {
    applicationId "com.application"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
useLibrary 'org.apache.http.legacy'

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:recyclerview-v7:23.2.0'
compile 'org.altbeacon:android-beacon-library:2.+'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.google.android.gms:play-services-gcm:10.2.1'
compile 'com.google.code.gson:gson:2.7'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'


testCompile 'junit:junit:4.12'
}



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

1 个答案:

答案 0 :(得分:1)

因为您正在使用

compile 'com.google.android.gms:play-services-gcm:10.2.1'

您与支持库v24。

有依赖关系

通常,您可以使用此命令检查依赖关系树。

./gradlew app:dependencies
相关问题