编译'com.android.support:multidex:1.0.1'出错:所有com android支持库必须使用完全相同的版本

时间:2017-03-06 09:49:16

标签: android android-studio gradle

今天,我将我的Android工作室更新为2.3,并将gradle更新为3.4.1。但是当我构建我的项目时,发生了一个错误: This is the error 所以我添加“buildToolsVersion '25 .0.0'”

我的项目可以成功构建,但发生了另一个错误。我无法解决它。我希望得到一些帮助。谢谢! This is the error

当我添加编译'com.prolificinteractive:material-calendarview:1.4.2'时,将发生此错误。 This is my androidDependencies

4 个答案:

答案 0 :(得分:13)

这可能是Android Studio 2.3的一个问题。有一个新的检查,检查com.android.support的所有依赖关系是否使用相同的版本号。但是,multidex没有匹配的版本号。您可以通过旁边的红灯灯泡图标禁用检查作为现在的解决方法

答案 1 :(得分:7)

这是支持的不必要的警告:multidex ,添加:

//noinspection AndroidLintGradleCompatible
compile 'com.android.support:multidex:1.0.1'

答案 2 :(得分:1)

我也在使用更新的Studio。您应该使用具有相同版本的每个库,以避免Manifest Merger问题。像这样。

 // To Support Design, CardView and RecyclerView Library
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:palette-v7:25.2.0'

// To Support MultiDex
compile 'com.android.support:multidex:1.0.1'

在这里,您会注意到每个库都具有相同的版本。

答案 3 :(得分:0)

com.android.support:recyclerview-v7 com.android.support:support-core-utils 的版本更改为 25.2.0 (支持库的最新版本:https://developer.android.com/topic/libraries/support-library/revisions.html