Facebook Sdk版本和支持:appcompat版本问题

时间:2017-11-03 15:23:27

标签: android facebook android-support-library facebook-sdk-4.x

我在我的android项目中使用这些依赖项。

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.4.0'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
        compile 'com.google.firebase:firebase-auth:11.4.2'
        compile 'com.facebook.android:facebook-android-sdk:4.27'
        compile 'com.android.support:design:25.4.0'
        compile "com.hanks:htextview-evaporate:0.1.1"
        compile 'com.rengwuxian.materialedittext:library:2.1.4'
        compile 'com.google.firebase:firebase-database:11.4.2'
        testCompile 'junit:junit:4.12'
    }

现在的问题是

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

它向我显示警告(在更新所有库的版本之后),如下所示:

  

所有com.android.support库必须使用完全相同的版本   规范(混合版本可能导致运行时崩溃)

当我删除Facebook Sdk Lib时。 compile 'com.facebook.android:facebook-android-sdk:4.27'

一切都很好,但显然我需要它。我不知道我该怎么做才能帮助我。

1 个答案:

答案 0 :(得分:1)

您收到错误是因为Facebook Sdk正在使用其他版本的Google支持库。您需要编译所有在鼠标悬停时出现错误警告您的库,并且您的gradle具有与支持库相同的版本。