简体   繁体   English

Firebase Crashlytics不发送崩溃报告

[英]Firebase Crashlytics not sending crash report

I am using firebase in my app. 我在我的应用程序中使用firebase。 I add Crashlytic to my app. 我将Crashlytic添加到我的应用程序中。 when I run, I simulate an exception but Crashlytic never generate and send report in my firebase console. 当我运行时,我模拟了一个异常,但Crashlytic从未生成并在我的firebase控制台中发送报告。 Below the exception I got. 在我得到的例外之下。

04-03 17:10:35.731 12442-12477/com.package.app E/CrashlyticsCore: Tried to write a fatal exception while no session was open.
04-03 17:10:39.733 12442-12442/com.package.app E/CrashlyticsCore: Failed to execute task.
    java.util.concurrent.TimeoutException
        at java.util.concurrent.FutureTask.get(FutureTask.java:177)
        at com.crashlytics.android.core.CrashlyticsBackgroundWorker.submitAndWait(CrashlyticsBackgroundWorker.java:41)
        at com.crashlytics.android.core.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:320)
        at com.crashlytics.android.core.CrashlyticsController$6.onUncaughtException(CrashlyticsController.java:300)
        at com.crashlytics.android.core.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:42)
        at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
        at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)

Even when I simulate crash from Crashlytic get started the app never crash 即使我从Crashlytic模拟崩溃开始 ,应用程序永远不会崩溃

Button crashButton = new Button(this);
crashButton.setText("Crash!");
crashButton.setOnClickListener(new View.OnClickListener() {
    public void onClick(View view) {
        Crashlytics.getInstance().crash(); // Force a crash
    }
});
addContentView(crashButton,
               new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
               ViewGroup.LayoutParams.WRAP_CONTENT));

and when I simulate my own app crash the report never generate and sent. 当我模拟我自己的应用程序崩溃时,报告永远不会生成和发送。

Gradle script project level Gradle脚本项目级别

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        maven {url 'https://maven.fabric.io/public'}

        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.1.2'
        classpath 'io.fabric.tools:gradle:1.25.1'
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
        maven { url "https://jitpack.io" }
        google()
    }
}

Gradle build script app level Gradle构建脚本应用程序级别

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "xxxxxxxxxxxxxxxxxxxxxxxx"
        minSdkVersion 14
        targetSdkVersion 27
        versionCode 3
        versionName "1.0.2"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
            ext.enableCrashlytics = true
        }
    }

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-annotations:27.0.2'
    //..........some dependencies
    implementation 'com.android.support:design:27.0.2'
    //implementation 'com.android.support:animated-vector-drawable:27.0.2'
    implementation 'com.android.support:recyclerview-v7:27.0.2'
    implementation 'com.android.support:cardview-v7:27.0.2'
    implementation 'com.android.support:support-v4:27.0.2'
    //implementation 'com.squareup.okhttp3:okhttp:1.5.4'
    implementation 'com.firebaseui:firebase-ui-database:3.2.2'
    implementation 'com.firebaseui:firebase-ui-storage:3.2.2'
    //implementation 'com.google.firebase:firebase-core:12.0.0'
    //................. some dependencies
    //Crashlytics sdk dependency
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.1'
}

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

I hope you have enabled notifications in fabric dashboard settings for the test crash that your are generating in you code. 我希望您在结构信息中心设置中启用了通知,以便您在代码中生成测试崩溃。

after enabling , You will then get crash mails. 启用后,您将收到崩溃邮件。

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

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