我的 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/