7

I am using firebase in my app. I add Crashlytic to my app. when I run, I simulate an exception but Crashlytic never generate and send report in my firebase console. 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

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

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

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'
Cœur
  • 37,241
  • 25
  • 195
  • 267
  • is your internet connected? seems like it's timing out – Kushan Apr 03 '18 at 17:36
  • Yes connected to network. I run the app in my real device and it is connected. – Jean-Pascal MEWENEMESSE Apr 03 '18 at 17:41
  • you know what, maybe try a normal crash instead of the simulated one... try throwing an exception. Maybe the API call is glitchy. Also do make sure that you have setup crashlytics exactly according to the steps they asked – Kushan Apr 03 '18 at 17:43
  • could you post your gradle files (both app and project level) as well as the place where you initialize crashalytics? – Levi Moreira Apr 03 '18 at 17:49
  • I made changes in my question with Crashlytic configuration. I also already enabled it in my firebase console. according to the documentation that is all we need to do to make it works. – Jean-Pascal MEWENEMESSE Apr 03 '18 at 17:51
  • I already simulate with my own exception but same output in my logcat. @Kushan – Jean-Pascal MEWENEMESSE Apr 03 '18 at 17:52
  • can you post your manifest? – Kushan Apr 03 '18 at 18:00
  • also which build are you using? release or debug? – Kushan Apr 03 '18 at 18:01
  • I am using debug build. Do I need to do some changes in the manifest? I did not make changes in my manifest. Please advise. – Jean-Pascal MEWENEMESSE Apr 03 '18 at 18:53
  • I doubt it's a problem, but this is not needed in your build file: `ext.enableCrashlytics = true`. Also, if you have any Firebase or Google Play services libs in your dependencies that are not included in what you posted, they should be 11.8.0 not 12.0.0; for compatibility with FirebaseUI 3.2.2. – Bob Snyder Apr 03 '18 at 19:07
  • I am using 11.8.0 version. inside wich bloc do I need to put `ext.enableCrashlytics = true` in gradle build script ? @BobSnyder – Jean-Pascal MEWENEMESSE Apr 04 '18 at 09:09
  • 1
    Crashlytics works for me without `ext.enableCrashlytics`. It's not in the [setup instructions](https://firebase.google.com/docs/crashlytics/get-started). Why do you think it's needed? – Bob Snyder Apr 04 '18 at 14:01
  • I"ve added an answer under the following StackOverlow thread about a possible solution: https://stackoverflow.com/questions/32197659/crashlytics-fabric-failed-to-execute-task/57795922#57795922 – Zsolt N. Szabo Sep 04 '19 at 21:44

1 Answers1

2

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.

Relsell
  • 771
  • 6
  • 18