我在下面的库中添加了它在这个库中显示错误 - compile' com.android.support:appcompat-v7:23.4.0'为什么呢?

时间:2017-03-13 05:22:42

标签: android firebase crash libraries

 compile 'com.android.support:appcompat-v7:23.4.0'
        compile 'com.android.support.constraint:constraint-layout:1.0.1'
        compile 'com.google.firebase:firebase-core:10.2.0'
        compile 'com.google.firebase:firebase-database:10.2.0'
  
    

  
its showing this error

> All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes).
     

发现版本24.0.0,23.4.0。例子包括   com.android.support:support-v4:24.0.0和   com.android.support:animated-vector-drawable:23.4.0

3 个答案:

答案 0 :(得分:1)

将所有内容用作唯一的:

例如:

这里我使用的是24版本。

android {
compileSdkVersion 24
buildToolsVersion '24.0.0'
defaultConfig {
    applicationId "com.mobile"
    minSdkVersion 17
    targetSdkVersion 24
    // useJack = true

    renderscriptTargetApi 19
    renderscriptSupportModeEnabled true

    multiDexEnabled true
}

Use all library as same versions. Please check the libraries are same versions.

  compile 'com.android.support:support-v4:24.0.0'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
compile 'com.android.support:design:24.0.0'

答案 1 :(得分:0)

因为您正在使用:

    compile 'com.google.firebase:firebase-core:10.2.0'

您对支持库24.0.0有依赖关系。

然后你必须改变

compile 'com.android.support:appcompat-v7:23.4.0'

 compile 'com.android.support:appcompat-v7:24.0.0'

答案 2 :(得分:-1)

您可以将compileSdk版本更改为23以删除错误。

实际上,编译sdk版本应该与依赖项匹配,即如果你的编译版本是24,那么依赖项也应该是24。