androidfirebaseforceclosefirebase-crash-reporting

Using a custom crash handler with Firebase installed


I've been using a neat library to handle force-close crashes:

https://github.com/Ereza/CustomActivityOnCrash

It's been working great until I decided to add Firebase Notifications to my app. I've only selected Notifications and as such I've only added the following dependency:

compile 'com.google.firebase:firebase-messaging:10.0.1'

For some reason, Firebase Crash Reports is also being initialized, because the custom crash handler see's it and even displays the following message:

E/CustomActivityOnCrash: IMPORTANT WARNING! You already have an UncaughtExceptionHandler, 
are you sure this is correct? If you use ACRA, Crashlytics or similar libraries, 
you must initialize them AFTER CustomActivityOnCrash! Installing anyway, but your
original handler will not be called.

My custom crash handler is the very first thing initialized in my (Application) onCreate() method, so I don't see where or how to prevent Firebase Crash reporting from loading/initializing itself.

Any help would be greatly appreciated!


Solution

  • I found my answer thanks to @BobSnyder's comment - it lead me to search and find this previous question/answer:

    How to disable default Firebase crash reporting?

    and ultimately I am using this answer to solve my issue:

    If you want to disable the Firebase Analytics Crash Reporting, use the below 
    code inside app.gradle file.
    
    configurations {
        all*.exclude group: 'com.google.firebase', module: 'firebase-crash'
    }