android - Firebase 身份验证和数据库链接
问题描述
在 android studio 3.1.3 中,用于链接 firebase 身份验证“ implementation 'com.google.firebase:firebase-auth:11.6.0' ” 并用于链接 firebase database “ implementation 'com.google.firebase:firebase-database:11.8.0 ' " 是应用级别 gradle 中提供的默认依赖项。
classpath 'com.google.gms:google-services:3.0.0'是添加的依赖项
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.project.arsalan.adda"
minSdkVersion 21
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'
}
}
}
repositories {
maven {
url "https://maven.google.com/"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:9.8.0'
implementation 'com.google.firebase:firebase-auth:9.8.0'
implementation 'com.google.firebase:firebase-database:9.8.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.android.support:cardview-v7:27.1.1'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.yarolegovich:lovely-dialog:1.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:percent:25.0.1'
}
apply plugin: 'com.google.gms.google-services'
在项目级别的gradle中。
我正在使用 gradle 3.1.2
不同级别的firebase导致我出错。请提供可与我的 gradle 构建一起使用的通用级别的 firebase 版本。
解决方案
只需更新它们
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
和你的谷歌 gms 更新
dependencies {
classpath 'com.google.gms:google-services:4.0.1'
// ...
}
推荐阅读
- dialogflow-es - 如何在 Dialogflow 中捕获用户的自由言论?
- python - Python将上下文添加到循环中的日志记录
- r - 更改堆叠 Geom_Bar 的顺序
- ruby-on-rails-5 - ruby gem audited 不记录 created_at 和 updated_at
- mysql - 如何编辑整个数据库中一行的值
- javascript - 如何验证表单中的多封电子邮件?
- javascript - 从 html input="date" 到 html 选择下拉格式
- python-3.x - 使用自定义简历在 Sklearn 中进行交叉验证
- html - 我的代码和命令中有 crud 问题
- php - 计算项目中方法的行数