Firebase API初始化失败Android+Firebase



任何人请帮帮我我是android开发的新手,请帮帮我。

我添加了一个firebaserecyclerview和firebaseui之后,我得到了这个错误,我不知道该怎么做

在我模块的gradle文件中,我添加了:

compile 'com.google.firebase:firebase-auth:11.6.0' and 
'com.google.firebase:firebase-database:11.6.0'

完整的Gradle文件如下所示:

顶级渐变文件

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
google()
jcenter()
maven()
{
url "https://google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

模块渐变文件

apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.pachu.my_notification"
minSdkVersion 21
targetSdkVersion 28
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(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-database:11.6.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.firebaseui:firebase-ui-database:4.2.1'
implementation 'com.android.support:recyclerview-v7:28.0.0'
}
apply plugin: 'com.google.gms.google-services'

根据FirebaseUI文档:

从4.2.1版本开始,FirebaseUI有以下依赖版本:

Library          Version
firebase-auth      16.0.5
play-services-auth 16.0.1
firebase-database  16.0.3
firebase-firestore 17.1.1
firebase-storage   16.0.3

因此,您需要将firebase-database更新为版本16.0.3,将firebase-auth更新为版本16.0.5

还将谷歌服务插件更新为4.2.0版本

相关内容

  • 没有找到相关文章

最新更新