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.

How Can I use ACRA and Firebase Crashlytics both?

See original GitHub issue

When I am using ACRA my firebase crashlytics is unable to collect the log. I know this is expected. But I need to use both of it.

I want to show the error dialog of acra instead of “Unfortunately App has stopped” and beside this I also want to send the error log to firebase crashlytics. Is there any possibilities to achieve that?

And if I implement my own custom sender then the AcraMailSender AcraDialog does not work.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mikehardycommented, Aug 9, 2020

ACRA does not chain default exception handlers, it replaces, yes. So you set up ACRA first, then chain to Crashlytics.

I don’t use Crashlytics in my ACRA-enabled app, but I do want to send things to google analytics at the same time ACRA is configured, so I initialize ACRA first, then I chain the default exception handles myself like this

https://github.com/ankidroid/Anki-Android/blob/2f0af8ff7c5cc18d850aa1fc8c1bdd2c39a6bb1c/AnkiDroid/src/main/java/com/ichi2/anki/AnkiDroidApp.java#L232-L261

https://github.com/ankidroid/Anki-Android/blob/2f0af8ff7c5cc18d850aa1fc8c1bdd2c39a6bb1c/AnkiDroid/src/main/java/com/ichi2/anki/analytics/UsageAnalytics.java#L123-L132

Looks like crashlytics does the same as my UsageAnalytics class - it chains to the existing handler:

https://github.com/firebase/firebase-android-sdk/blob/master/firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsUncaughtExceptionHandler.java#L63

So it’s an order-of-initialization thing unless ACRA implements chaining to an existing handler. Initialize ACRA first, then initialize Crashlytics at runtime by disabling automatic collection then enabling it after your ACRA init like so https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=android#enable-reporting

0reactions
tushar09commented, Aug 11, 2020

@F43nd1r your wild guess was right. Thank you so much. Now I am initializing ACRA in Application.attachBaseContext and it worked like a charme.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get started with Firebase Crashlytics - Google
Setting up Crashlytics requires tasks both in the Firebase console and your IDE (like adding a Firebase configuration file and the Crashlytics SDK)....
Read more >
Using a custom crash handler with Firebase installed
When I run an app without FirebaseCrash, I see D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization .
Read more >
Crashlytics vs. firebase - G2
Compare Crashlytics and firebase head-to-head across pricing, user satisfaction, and features, using data from actual users.
Read more >
How we reduced app crashes by 99% | by Prashant - Medium
Even Firebase Crashlytics does not have enough data to replicate or ... On researching, we found ACRA(Application Crash Reports for Android).
Read more >
How do HockeyApp, Crashlytics, Crittercism, BugSense ...
ACRA + HockeyApp ... As a developer that has used both (actually still using both), ... Which is better, Crashlytics or Firebase Crash...
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