首页 > 解决方案 > 无法连接到 Firebase 和应用程序崩溃

问题描述

我正在尝试连接到 Android Studio 3.2.1 中的 firebase。应用 后implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0',firebase 依赖项设置正确,当我删除 15.0.0 时,firebase 依赖项断开连接。此外,当连接到手机(Android 版本 7.1.1,系统版本 26.31.1)时,应用程序崩溃了。

我该如何进行?

apply plugin: 'com.android.application'


apply plugin: 'com.google.gms.google-services'

implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'

implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-core:16.0.4'


implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
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.android.gms:play-services-maps:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.2'


implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'

标签: android

解决方案


推荐阅读