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

标签 android android-studio gradle build.gradle

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

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'

最佳答案

因为你正在使用

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

您依赖于支持库 v24。

一般来说,您可以使用此命令检查您的依赖关系树。

./gradlew app:dependencies

关于android - 所有 com.android.support 库必须使用完全相同的版本规范 gradle 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43389136/

相关文章:

java - 如何不重复使用BitmapShader

android - 如何在 Android Studio 的 Logcat 选项卡中增加过滤器输入的大小

android - 尝试在什么应用程序(未安装)上共享它时,我的android应用程序崩溃

android - 下载开始并显示应用程序后如何关闭 WebBrowser?

scala - Gradle Scala 插件在 sbt 中添加 CompilerPlugin 的必然结果

java - 无法将按钮文本设置为 "<<<"

java - 我的应用程序忽略按钮背景颜色的任何更改

Android 设备调试

Android 特定的 Gradle 产品 flavor 组合

groovy - 编译Groovy类