Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setCustomKey doesn't work in firebase crashlytics

Following the docs, I've added:

FirebaseCrashlytics.getInstance().setCustomKey("my_string_key", "foo" /* string value */)

I'm using the latest version of crashlytics:

implementation platform('com.google.firebase:firebase-bom:30.3.1')
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'

I've forced a crash like this:

throw RuntimeException("Test Crash6")

The crash is showing up in the dashboard, but not the custom key:

enter image description here

enter image description here

like image 290
Jim Clermonts Avatar asked Aug 09 '26 08:08

Jim Clermonts


1 Answers

My soultion is call recordException() before setCustomKey(). And remove your App from Recent App then open the App again.

You can retrieve the key and value in your Firebase console. This may not be the standard way to use Firebase APIs, but it works."

Ex.

FirebaseCrashlytics.getInstance().recordException(RuntimeException(""))
FirebaseCrashlytics.getInstance().setCustomKey(somekey, someValue)
like image 52
hxc Avatar answered Aug 10 '26 20:08

hxc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!