所有库必须使用相同的版本 [英] All the libraries must use the same versions

查看:21
本文介绍了所有库必须使用相同的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的依赖

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 时,在 appcompat 行中出现错误,示例包括 ..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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆