Track Android App Crashes Using Firebase Crashlytics
Crashes irritate the users and ruin the impression of the application while frequent crashes provoke the user to uninstall the application. Most of them might choose a competitors app and some of them might leave bad reviews on the Play Store.
Either way, the application crashes negatively affect the business. Minimizing crashes is critical in improving overall user experience and retaining them.
Best way to understand the issues in the application is by tracking crashes and solving. We need to find out if a particular crash is impacting a lot of users, get alerts when an issue suddenly increases in severity. and figure out which lines of code are causing crashes.
Firebase Crashlytics is one such product that helps track crashes in realtime, understand the severity, get a glimpse of user composition affected by the crash, stack trace to resolve the crash and more.
Before we start integrating the Firebase Crashlytics, we need to add Firebase to our project. Once we have added Firebase, adding Firebase Crashlytics to our project can be done in three simple steps.
First, add the Crashlytics Gradle plugin dependency to the project level
build.gradle
file under the buildscript
block.classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
Next, apply the plugin in the app level
build.gradle
file.apply plugin: 'com.google.firebase.crashlytics'
Finally, add the Crashlytics dependency in the app level
build.gradle
file.implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
That's it. In case if we want to track the NDK crashes then we need to follow additional steps.
Add the
firebaseCrashlytics
extension inside the release
build type.firebaseCrashlytics { nativeSymbolUploadEnabled true strippedNativeLibsDir 'build/stripped' unstrippedNativeLibsDir 'build/unstripped'}
Update the Crashlytics dependency in the app level
build.gradle
file with the following one.implementation 'com.google.firebase:firebase-crashlytics-ndk:17.2.1'
Create a version, upload the app to the Play Store and crashes will appear in your Firebase Crashlytics console.