参见英文答案 > All com.android.support libraries must use the exact same version specification????????????????????????????????????54个
当我今天将我的android工作室从版本2.2.3更新到2.3时,突然在我的build.gradle中在依赖项的第一个编译行中出现此错误
(无论哪个依赖都会出现在第一位,但它总会给我这个错误):
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.2.0, 24.0.0. Examples include com.android.support:animated-vector-drawable:25.2.0 and com.android.support:mediarouter-v7:24.0.0
我查看了整个项目,我找不到任何版本24.0.0的用法(我用ctrl shift F查看整个项目中的搜索)
这是我的build.gradle:
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
versionName "1.0"
versionCode 1
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
minifyEnabled true
shrinkResources true
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.squareup:otto:1.3.8'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:multidex:1.0.1'
}