简体   繁体   English

Android 使用 Firebase 数据库的应用程序在启动时不断崩溃?

[英]Android Application using Firebase database keeps crashing when launching?

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:这是我在 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'

}

try adding multidex support尝试添加多索引支持

defaultConfig {
    // Your previous stuffs
    multiDexEnabled true
}

for more info you can visit this thread.有关更多信息,您可以访问此线程。 This can be helpful too: https://stackoverflow.com/a/39831657/7237222这也很有帮助: https://stackoverflow.com/a/39831657/7237222

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM