question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crashlytics custom keys are not deleted after sending a non-fatal exception

See original GitHub issue

Step 1: Describe your environment

  • Android Studio version: 4.1
  • Firebase Component: crashlytics, messaging
  • Component version: Crashlytics v17.2.1 | messaging v17.6.0

Step 2: Describe the problem

Crashlytics custom keys are not deleted after sending a non-fatal exception

Steps to reproduce:

  1. I log some non-fatal exception with additional info (as described here: https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=android#log-excepts). Here is the function:
fun logNonFatalException(e: Exception) {
   if (e is MyCustomException) {
      FirebaseCrashlytics.getInstance().setCustomKey(e.key, e.value)
   }
  
   FirebaseCrashlytics.getInstance().recordException(e)
}

Then if any exception else happened, I will see next Crashlytics reports with all of the custom keys I added before.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
romanandreyvichcommented, Dec 2, 2020

Got it, thanks again.

0reactions
romanandreyvichcommented, Dec 10, 2020

My major problem is that I want to attach custom info to a particular exception and I have no idea how to do that in Crashlytics. Docs suggest to use custom keys so I tried to follow the advice and ended up with that issue: before recording the exception I add custom info using keys. After recording the exception I remove the keys. Since exception recording is async the keys are removed BEFORE the recording happens. I’m not sure I understand what issue should I create exactly? That I can’t attach custom info to an exception or that custom keys API doesn’t handle that case?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customize your Firebase Crashlytics crash reports - Google
Custom keys help you get the specific state of your app leading up to a crash. You can associate arbitrary key/value pairs with...
Read more >
Crashlytics(Android) clear log before next crash - Stack Overflow
I have a situation where I want to add some logs to Crashlystic for Android, but not always send it.
Read more >
Boost your Crashlytics reports with custom keys & log messages
Firebase Crashlytics provides two important tools to log some extra information about your crashes and non-fatal issues: custom keys and logs messages.
Read more >
Firebase crashlytics not able to read crash reports · Issue #1559
I was enabling Crashlytics into my android app and seem to get the same error when I throw a custom error to test...
Read more >
FirebaseCrashlytics not logging non-fatal errors (Android)
Pretty sure that you need to recordException to send to crashlytics and all logs just gets added to that exception. Otherwise it just...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found