📱

Implementing Firebase Crashlytics in Android Apps

Oct 11, 2024

Lecture on Implementing Firebase Crashlytics

Introduction

  • Focus of the lesson: Implementing Firebase Crashlytics
  • Importance of Crashlytics:
    • Collects crash analytics
    • Essential for production environment on Google Play Store
    • Helps in gathering information on application crashes

Steps for Implementation

Creating a Firebase Project

  1. Start a New Firebase Project
    • Name it appropriately (e.g., Udemy Course)
    • Configure location settings (default to US)
    • Complete project setup

Setting up Firebase in Android Studio

  1. Dependencies Setup

    • Open Android Studio
    • Go to Firebase console
    • Configure application with project details:
      • Application ID
      • Optional app name
      • Optional SHA1 key for phone verification
  2. Download Configuration Files

    • Download google-services.json
    • Place it in the app directory (not the root directory)
  3. Modify Gradle Files

    • Add dependencies and plugins in build.gradle:
      • Top-level build.gradle: Add Google services classpath
      • App-level build.gradle: Implement Firebase Crashlytics and Analytics
    • Synchronize project with Gradle files

Running and Testing the Application

  1. Communication Setup
    • Ensure application communicates with Firebase server
    • Run application to establish connection
    • Use Crashlytics setup to verify installation
  2. Forcing a Crash
    • Implement test crash by inserting code
    • Run application to intentionally crash it
    • Verify crash report in Firebase console
    • Refresh console to see crash logs

Post-Implementation

Monitoring and Analysis

  • Review crash details in Firebase console
  • Utilize logs and detailed crash reports
  • Analyze device-specific crash data

Future Work

  • Next lecture will cover configuration with Timber
    • Managing release and debug configurations
    • Sending crash reports in release mode

Conclusion

  • Importance of crash analytics in production
  • Ensuring stability across different devices
  • Preparing for next steps with application logging and configuration