添加Firebase后,所有com.android.support库都必须使用完全相同的版本规范 [英] All com.android.support libraries must use the exact same version specification after adding firebase
问题描述
我的android Studio显示此错误.
My android Studio shows this error.
所有com.android.support库必须使用完全相同的版本 规范(混合版本可能导致运行时崩溃).成立 版本27.1.1、26.1.0.例子包括 com.android.support:animated-vector-drawable:27.1.1和 com.android.support:support-media-compat:26.1.0以下...(Ctrl + F1) 有一些库,工具和库的组合, 不兼容,或可能导致错误.一种这样的不兼容是 使用不支持的Android支持库版本进行编译 最新版本(或特别是低于您的版本 targetSdkVersion).
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'
推荐答案
像com.google.firebase:firebase-core:15.0.0
这样的主题取决于较早的支持库版本(26.1.0
).
已经发布了15.0.2
版本,因此您可以尝试:
It themes like com.google.firebase:firebase-core:15.0.0
depends on older support library varsion (26.1.0
).
There already is 15.0.2
version released, so you could try to:
- 使用Firebase Core的
15.0.2
版本.可能是基于最新的支持库 - 忽略此消息,因为它是警告,而不是错误,可能您的应用程序可以正常使用. (不推荐,但可以使用)
- 将使用的支持库版本降级为
26.1.0
,因此它们是相同的版本.至少在google根据最新的支持lib版本发布firebase之前. (如果#1不起作用,建议的方式)
- use
15.0.2
version of firebase core. Probably it is based on latest support lib - ignore this message, as it is a warning, not an error, and probably your app would work fine with it. (not recommended, but could work)
- downgrade your used support libs version to
26.1.0
so they are the same version. At least until google releases firebase based on the latest support lib version. (recommended way if #1 didn't work)
这篇关于添加Firebase后,所有com.android.support库都必须使用完全相同的版本规范的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!