使用Firebase数据库的Android应用程序在启动时不断崩溃吗? [英] Android Application using Firebase database keeps crashing when launching?

查看:43
本文介绍了使用Firebase数据库的Android应用程序在启动时不断崩溃吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我目前正在尝试将用户详细信息存储到数据库中,但是该程序在执行时未提及任何错误,但是在尝试打开它时,应用程序不断崩溃.这是我在logcat中的错误代码:

So I am currently trying to store user details into a database, however the program does not mention any errors upon execution, but the application keeps on crashing when trying to open it. This is my error code in logcat:

将根据要求提供代码要领

Code gist will be provided upon request

build.gradle

build.gradle

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

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.2"

    defaultConfig {
        applicationId "com.example.finalyearprojectapp"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.android.support:multidex:1.0.3'
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-firestore:22.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

}

推荐答案

尝试添加对multidex的支持

try adding multidex support

defaultConfig {
    // Your previous stuffs
    multiDexEnabled true
}

有关更多信息,您可以访问此线程.这也可能会有所帮助: https://stackoverflow.com/a/39831657/7237222

for more info you can visit this thread. This can be helpful too: https://stackoverflow.com/a/39831657/7237222

这篇关于使用Firebase数据库的Android应用程序在启动时不断崩溃吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆