android - 添加 firebase 后,所有 com.android.support 库必须使用完全相同的版本规范

标签 android firebase

我的 android Studio 显示此错误。

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 26.1.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:support-media-compat:26.1.0 less... (Ctrl+F1) There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion).

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.firebase:firebase-core:15.0.0'

最佳答案

您可以通过覆盖支持库来解决问题,而不是降级或排除支持库。您可以通过添加错误中的依赖项来覆盖支持库:

implementation "com.android.support:animated-vector-drawable:27.1.1"

关于这个答案的争论,你可以在Firebase中看到以下问题:

关于android - 添加 firebase 后,所有 com.android.support 库必须使用完全相同的版本规范,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50363148/

相关文章:

java - java代码中使用kotlin时void无法转换为Unit - android

ios - Firebase - 读取和获取数据的效率

firebase - 在 React Native 一段时间后删除通知(@react-native-firebase/messaging)

ios - 如何简单地用评论填充 tableView?

android - 火力基地 : What is the difference between setPersistenceEnabled and keepSynced?

java - 将 JSON URL 传递给 java Restful WebService

ANDROID-如何将 gridView 中的选定项目保存在字符串中?

java - android动画图片变化

Firebase 身份验证 : Emails sent but not received on special email addresses such as *@gmx. 位于

firebase - 我可以在本地运行Firebase Storage云功能吗?