【发布时间】:2019-06-14 07:49:29
【问题描述】:
我正在创建一个使用 firebase 身份验证进行登录和注册的应用程序,但我在运行该应用程序时不断突然崩溃。我在应用程序级别的 Gradle.build 文件中收到警告。警告说
所有 com.android.support 库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。找到版本 28.0.0、26.1.0。示例包括 com.android.support:animated-vector-drawable:28.0.0 和 com.android.support:support-media-compat:26.1.0
我尝试将 com.android.support:appcompat-v7:28.0.0 更改为 v7:26.0.1 和 27.1.0,但都没有解决问题。
我的 build.gradle 文件如下:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.project.tck.rescueme_responder"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
我希望在我运行应用程序时使用 FireBase 进行身份验证,但每次运行时应用程序都会崩溃。
【问题讨论】:
-
您是否尝试过匹配 Firebase 依赖项的版本号?示例:实施 'com.google.firebase:firebase-core:16.1.0' 实施 'com.google.firebase:firebase-auth:16.1.0'
-
不,我没有,遗憾的是我的笔记本电脑今天被盗了,所以我必须在另一台机器上重新启动项目。但我会试一试。感谢您的贡献。