所有com.android.support库都必须使用完全相同的版本规范.在android studio 2.3中找到版本27.0.2、25.1.0、25.0.0 [英] All com.android.support libraries must use the exact same version specification . Found versions 27.0.2, 25.1.0, 25.0.0 in android studio 2.3
问题描述
我在gradle文件中有一个错误用于编译'com.android.support:appcompat-v7:27.0.2'.
I have one error in gradle file for compile 'com.android.support:appcompat-v7:27.0.2'.
渐变版本为2.3.0
gradle version is 2.3.0
我搜索了很多,但无法解决此问题. 我的错误是:
I searched a lot ,but could not solve this problem. my error is:
所有com.android.support库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃).找到版本27.0.2、25.1.0、25.0.0.示例包括com.android.support:animated-vector-drawable:27.0.2和com.android.support:design:25.1.0
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.0.2, 25.1.0, 25.0.0. Examples include com.android.support:animated-vector-drawable:27.0.2 and com.android.support:design:25.1.0
app/build.gradle
:
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "com.example.pegah_system.sanduqchehproject"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
}
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.squareup.retrofit2:retrofit:2.0.0-beta4') {
exclude module: 'okhttp'
}
compile 'com.github.bumptech.glide:glide:3.8.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.0'
compile 'com.github.ybq:Endless-RecyclerView:1.0.3'
compile 'com.github.ybq:Android-SpinKit:1.1.0'
compile 'com.github.qdxxxx:BezierViewPager:v1.0.5'
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.roughike:bottom-bar:2.1.2'
compile 'com.squareup.okhttp3:okhttp:3.0.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:support-v4:27.0.2'
testCompile 'junit:junit:4.12'
}
推荐答案
问题是因为项目中的依赖项存在冲突.您正在使用某些库,这些库隐式使用支持库27.0.2
,25.1.0
和25.0.0
.
The problem is because there are conflicted dependencies in your project. You're using some libraries which implicitly using support library 27.0.2
, 25.1.0
, and 25.0.0
.
以下库使用的支持库不同于27.0.2:
The following libraries is using a different support library than 27.0.2:
compile 'com.github.qdxxxx:BezierViewPager:v1.0.5'
compile 'com.roughike:bottom-bar:2.1.2'
BezierViewPager在其 build.gradle :
BezierViewPager is using support library inside its build.gradle:
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:appcompat-v7:25.0.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
}
bottom-bar库在其版本中使用支持库25.0.2
. gradle 和库build.gradle :
bottom-bar library is using support library 25.0.2
in its build.gradle and library build.gradle:
ext {
compileSdkVersion = 25
buildToolsVersion = "25.0.2"
minSdkVersion = 11
targetSdkVersion = 25
supportLibraryVersion = "25.3.0"
junitVersion = "4.12"
}
因此,您需要从中排除支持库.您可以这样做:
So, you need to exclude the support library from them. You can do it with this:
compile ("com.github.qdxxxx:BezierViewPager:v1.0.5") {
exclude group: 'com.android.support'
exclude module: 'appcompat-v7'
exclude module: 'cardview-v7'
}
compile ("com.roughike:bottom-bar:2.1.2") {
exclude group: 'com.android.support'
exclude module: 'appcompat-v7'
exclude module: 'design'
}
如果仍然找到冲突的库,则可以使用以下方法检查依赖关系树:
You can check the dependencies tree if you still found the conflicted libraries with:
./gradlew app:dependencies
这篇关于所有com.android.support库都必须使用完全相同的版本规范.在android studio 2.3中找到版本27.0.2、25.1.0、25.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!