Search code examples
androidfirebasefirebase-crash-reporting

Why I don't see Logs in Firebase Crash Reporting


I'm using Firebase Crash Reporting.

I saw here feature which is called Logs.

But how to use this?

I've Google Analytics in my project, and I'm trying to log crashes using FirebaseCrash.log() exactly in the same method.

public void sendGoogleAnalyticsEvent(String category, String label, String action) {
    Map<String, String> build = new HitBuilders.EventBuilder()
            .setCategory(category)
            .setLabel(label)
            .setAction(action)
            .build();
    tracker.send(build);
    FirebaseCrash.log("Category: " + category + " label: " + label + " action: " + action);
}

But I don't see any Logs in the crash. This guy speak about automatically logged events, I don't see this too. What is wrong ? enter image description here

UPDATE: If I select 'Analytics' from the Firebase menu, there everything is shown and works correctly


Solution

  • Make sure you are using the latest version of Firebase Crash Reporting SDK, currently 10.0.1

    The log that will appear in Firebase Crash Reporting is imported from Firebase Analytics, so you have to use Firebase Analytics instead. source

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

    For example:

    Bundle bundle = new Bundle();
    bundle.putString("name", "button");
    FirebaseAnalytics.getInstance(this).logEvent("button_click", bundle);
    
    throw new RuntimeException("This is a crash");
    

    the result is shown in this screenshot below

    enter image description here