How Can I use ACRA and Firebase Crashlytics both?
See original GitHub issueIssue Description
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:
- Created 3 years ago
- Comments:12 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
@F43nd1r your wild guess was right. Thank you so much. Now I am initializing ACRA in
Application.attachBaseContext
and it worked like a charme.