0
0
Firebasecloud~5 mins

Crashlytics setup in Firebase - Commands & Configuration

Choose your learning style9 modes available
Introduction
Crashlytics helps you find and fix app crashes quickly. It collects crash reports from your app so you can improve its stability.
When you want to know why your app crashes on users' devices.
When you need detailed reports about errors in your app.
When you want to prioritize fixing bugs that affect many users.
When you want to monitor app health after releasing updates.
When you want automatic alerts for new or frequent crashes.
Config File - firebase.json
firebase.json
{
  "react-native": {
    "crashlytics_debug_enabled": true,
    "crashlytics_auto_collection_enabled": true
  }
}

This file configures Firebase Crashlytics for a React Native app.

crashlytics_debug_enabled: Enables crash reporting during development.

crashlytics_auto_collection_enabled: Automatically collects crash reports without extra code.

Commands
Log in to your Firebase account to access your projects and services.
Terminal
firebase login
Expected OutputExpected
✔ Success! Logged in as user@example.com
Initialize Crashlytics in your Firebase project to set up necessary files and configurations.
Terminal
firebase init crashlytics
Expected OutputExpected
=== Crashlytics Setup === ✔ Firebase Crashlytics has been initialized in your project.
Deploy the Crashlytics configuration to Firebase so it starts monitoring your app crashes.
Terminal
firebase deploy --only crashlytics
Expected OutputExpected
=== Deploying to 'your-project-id' === ✔ Deploy complete! Project Console: https://console.firebase.google.com/project/your-project-id/overview
--only - Deploy only the specified Firebase service, here Crashlytics.
List current crash issues reported by Crashlytics to verify it is collecting data.
Terminal
firebase crashlytics:issues:list
Expected OutputExpected
No crash issues found. (Or a list of crash issues with IDs and descriptions)
Key Concept

If you remember nothing else from this pattern, remember: Crashlytics automatically collects crash reports after setup so you can fix app problems faster.

Common Mistakes
Not logging into Firebase CLI before initializing Crashlytics
The CLI commands fail because they need authentication to access your Firebase project.
Always run 'firebase login' first to authenticate.
Skipping the deploy step after initialization
Crashlytics settings won't apply until you deploy, so no crash data will be collected.
Run 'firebase deploy --only crashlytics' to apply your configuration.
Not enabling automatic crash collection in the config file
Crash reports won't be sent automatically, requiring manual code changes.
Set 'crashlytics_auto_collection_enabled' to true in firebase.json.
Summary
Log in to Firebase CLI to access your project.
Initialize Crashlytics to set up monitoring files.
Deploy Crashlytics configuration to start collecting crash reports.
Check crash issues to verify Crashlytics is working.