所有库必须使用相同的版本 [英] All the libraries must use the same versions
问题描述
我的依赖
dependencies {
compile 'me.dm7.barcodescanner:zxing:1.9'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
}
当编译发现版本27.1.1,26.1.0
的示例包括.. vectordrawable 27.1.1
nd supportdesign 26.1.0
I get an error in appcompat
line when compiling that found version 27.1.1,26.1.0
examples include ..vectordrawable 27.1.1
nd supportdesign 26.1.0
我的目标SDK是26.
My target SDK is 26.
我尝试将版本切换到27,但我的SDK目标是26,但出现错误.
I tried to switch versions to 27 but my SDK target is 26, I get an error.
推荐答案
每当您看到这种类型的问题时,请在gradle文件中与其他支持库的相同版本显式声明该探查库:
Whenever you see this type of problem, explicitly declare the probelmatic libraries in your gradle file with the same version of your other support libs:
implementation "com.android.support:animated-vector-drawable:26.1.0"
implementation "com.android.support:design:26.1.0"
implementation 'com.android.support:support-vector-drawable:26.1.0'
之所以发生这种情况,是因为您的某些依赖项使用了不同的版本.
This happens because some of your dependencies use a different version of it.
此外,使用实现不进行编译.编译已被弃用:
Also, use implementation not compile. Compile has been deprecated:
implementation 'me.dm7.barcodescanner:zxing:1.9'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
这篇关于所有库必须使用相同的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!