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

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

问题描述

在依赖项中添加'com.firebaseui:firebase-ui-auth:1.0.0'后出现错误。当我从Gradle中删除'com.firebaseui:firebase-ui-auth:1.0.0'时,错误消失。代码和图片包含在
帮助请求中

  apply plugin:'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion25.0.2
defaultConfig {
applicationIdcom.example.a.chatapp
minSdkVersion 22
targetSdkVersion 25
versionCode 1
versionName1.0
testInstrumentationRunnerandroid.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'c​​om.android.support:appcompat-v7:25.3。 0'



编译'com.firebaseui:firebase-ui:0.3.1'






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

解决方案

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



。起初你应该尝试更新firebase-ui依赖。他们通常保持支持依赖更新,所以我猜他们在当前的主分支中使用与您相同版本的支持库(我猜你使用最新的'com.android.support:appcompat'版本,对不对?)。
如果最新版本的firebase-auth不使用当前版本的支持库,则可以降级支持库版本,以便与它们匹配,您可以创建自己的firebase-auth分支并保持更新在你自己的。

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'

解决方案

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).

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错误混合版本可能会导致运行时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆