Search code examples
androidfirebasecrashlyticsfirebase-analytics

Firebase Crashlytics - setting User ID is not working?


A useful feature from Crashlytics by Firebase is to set a userID for a session, to later look up that particular user's crash events.

It doesn't seem to be working in my Android app however. I am debugging with my device. Here is the DebugView of my device:

enter image description here

Where the user_id is properly set via setUserID on the Firebase Analytics object.

I then triggered a crash. But...

enter image description here

It can't find my userID? (I can find the crash I triggered though.)

I don't even know what else to try, according to DebugView the userID was properly set?


Solution

  • Well, it was as simple as:

    FirebaseAnalytics.getInstance(this).setUserId(uuid); // wrong
    Crashlytics.setUserIdentifier(uuid);                // correct
    

    Was overlooking "FirebaseCrashlytics" vs "FirebaseAnalytics" https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=android