android studio 错误-混合版本可能导致运行时崩溃

android studio error- mixing versions can lead to run-time crashes(android studio 错误-混合版本可能导致运行时崩溃)

本文介绍了android studio 错误-混合版本可能导致运行时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将com.firebaseui:firebase-ui-auth:1.0.0"添加到依赖项后出现错误.当我从 gradle 中删除 'com.firebaseui:firebase-ui-auth:1.0.0' 时,错误消失了.代码和图片包括在下面请帮忙

I get an error after adding 'com.firebaseui:firebase-ui-auth:1.0.0' to the dependency. The error goes away when I delete 'com.firebaseui:firebase-ui-auth:1.0.0' from the gradle. Code and pic included below Help please

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "com.example.a.chatapp"
    minSdkVersion 22
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

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.3.0'



compile 'com.firebaseui:firebase-ui:0.3.1'






compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

推荐答案

问题是你使用了同一个依赖的两个(或多个)不同版本.第一个在您的 gradle 文件中指定,其他依赖项由您使用的库使用(在这种情况下可能是 firebase-ui).

The problem is that you use two (or more) different versions of the same dependency. The first one is specified in your gradle file and the other dependencies are used by library which you use (in this case firebase-ui probably).

您在这里有更多选择.首先,您应该尝试更新 firebase-ui 依赖项.他们通常会更新他们的支持依赖项,所以我猜他们在他们当前的主分支中使用与您相同版本的支持库(我猜您使用最新的 'com.android.support:appcompat' 版本,对吧?).如果最新版本的 firebase-auth 不使用当前版本的支持库,您可以降级您的支持库版本,使其与它们匹配,或者您可以创建自己的 firebase-auth 分支并自行更新.

You have more options here. At first you should try to update firebase-ui dependency. They usually keep their support dependecies updated so I guess that they use the same version of support libraries as you in their current master branch (I guess that you use the newest 'com.android.support:appcompat' version, right?). If the last version of firebase-auth doesn't use the current version of support libraries you can either downgrade your support libraries version so it will match their either you can create your own fork of firebase-auth and keep it updated on your own.

这篇关于android studio 错误-混合版本可能导致运行时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:android studio 错误-混合版本可能导致运行时崩溃

基础教程推荐