混合依赖版本 [英] Mixing dependencies versions
问题描述
我开始学习开发Android应用程序。
我正在遵循一个Firebase教程,并且在我的 build.gradle $ c中遇到一些错误。 $ c>文件。
I'm starting to learn develop android apps.
I'm following a firebase tutorial, and I'm getting some errors on my build.gradle
file.
有人可以帮助我吗?
我的版本。 gradle
文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "br.com.brunots.firebasetests"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation ''
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:11.8.0'
testImplementation 'junit:junit:4.1com.android.support:appcompat-v7:27.1.02'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.android.support:design:27.1.0'
compile 'com.firebaseui:firebase-ui:0.6.0'
}
apply plugin: 'com.google.gms.google-services'
这些是错误:
- 所有gms / firebase库必须使用完全相同的版本
规范(混合版本可能导致运行时崩溃)。发现
版本9.6.0、11.8.0。示例包括
com.google.android.gms:play-services-auth:9.6.0
和
com.google .android.gms:play-services-basement:11.8.0
- 所有com.android.support库必须使用完全相同的
规范(混合版本可能导致运行时崩溃)。发现
版本27.1.0,23.4.0。示例包括
com.android.support:animated-vector-drawable:27.1.0
和
com.android.support :cardview-v7:23.4.0
- All gms/firebase libraries must use the exact same version
specification (mixing versions can lead to runtime crashes). Found
versions 9.6.0, 11.8.0. Examples include
com.google.android.gms:play-services-auth:9.6.0
andcom.google.android.gms:play-services-basement:11.8.0
- All com.android.support libraries must use the exact same version
specification (mixing versions can lead to runtime crashes). Found
versions 27.1.0, 23.4.0. Examples include
com.android.support:animated-vector-drawable:27.1.0
andcom.android.support:cardview-v7:23.4.0
我不知道这个旧版本在哪里
I don't know where is this the older versions is declared.
推荐答案
这是因为您使用的是Firebase-ui版本0.6.0,该版本暗中使用了Firebase和Google Play服务版本9.6.0(有关详细信息,请参见 https:// github。 com / firebase / FirebaseUI-Android / releases / tag / 0.6.0 )。因此,您不能使用以下内容:
This is because you're using firebase-ui version 0.6.0 which is implicitly using firebase and google play service version 9.6.0 (read more about it at https://github.com/firebase/FirebaseUI-Android/releases/tag/0.6.0). So, you can't use the following:
implementation 'com.google.firebase:firebase-core:11.8.0'
compile 'com.firebaseui:firebase-ui:0.6.0'
使用正在使用Firebase 11.8.0的firebase-ui版本3.2.2(在
you need to use firebase-ui version 3.2.2 which is using firebase 11.8.0 ( read more at https://github.com/firebase/FirebaseUI-Android) like this:
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.firebaseui:firebase-ui:3.2.2'
,并且您还需要将支持库版本27.0.2用于firebase-ui 3.2.2(请参见 https://github.com/firebase/FirebaseUI-Android/blob/master/constants.gradle )
and you also need to use support library version 27.0.2 for firebase-ui 3.2.2 (look at https://github.com/firebase/FirebaseUI-Android/blob/master/constants.gradle)
这篇关于混合依赖版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!