0
0
Firebasecloud~10 mins

Crashlytics setup in Firebase - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Crashlytics setup
Add Firebase to Project
Add Crashlytics SDK
Initialize Crashlytics in App
Build and Run App
Crashlytics Uploads Crash Reports
View Crash Reports in Firebase Console
This flow shows the steps to set up Crashlytics: add Firebase, add SDK, initialize, run app, upload crash data, and view reports.
Execution Sample
Firebase
dependencies {
  implementation 'com.google.firebase:firebase-crashlytics:18.3.7'
}

FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
This code adds the Crashlytics SDK to the app and enables crash report collection.
Process Table
StepActionResultNext Step
1Add Firebase to projectFirebase project created and linkedAdd Crashlytics SDK
2Add Crashlytics SDK to appCrashlytics library included in buildInitialize Crashlytics in app code
3Initialize Crashlytics in appCrashlytics ready to capture crashesBuild and run app
4Build and run appApp runs with Crashlytics enabledCrashlytics collects crash data on failure
5Crash occurs in appCrashlytics captures crash reportUpload crash report to Firebase
6Crash report uploadedCrash data available in Firebase ConsoleView crash reports
7View crash reportsDeveloper sees crash details and stack tracesSetup complete
💡 Setup ends when crash reports are visible in Firebase Console
Status Tracker
VariableStartAfter Step 2After Step 3After Step 4After Step 6
Firebase ProjectNoneCreatedCreatedCreatedCreated
Crashlytics SDKNot addedAddedAddedAddedAdded
Crashlytics InitializedFalseFalseTrueTrueTrue
Crash Reports CollectedNoneNoneNoneCollectingUploaded
Key Moments - 3 Insights
Why do we need to initialize Crashlytics in the app code after adding the SDK?
Initialization activates Crashlytics to start capturing crashes; without it, the SDK is present but inactive (see execution_table step 3).
What happens if the app crashes before Crashlytics is initialized?
Crash reports won't be captured or uploaded because Crashlytics isn't active yet (refer to variable_tracker 'Crashlytics Initialized' before step 3).
Why must we build and run the app after setup?
Running the app triggers Crashlytics to start collecting crash data and upload reports on failures (execution_table step 4 and 5).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step is Crashlytics first ready to capture crashes?
AStep 4
BStep 2
CStep 3
DStep 5
💡 Hint
Check the 'Result' column for when Crashlytics is initialized (step 3).
According to variable_tracker, when do crash reports start being collected?
AAfter Step 4
BAfter Step 3
CAfter Step 2
DAfter Step 6
💡 Hint
Look at 'Crash Reports Collected' variable changes in variable_tracker.
If you skip initializing Crashlytics in the app, what will happen?
ACrash reports will still be collected
BCrash reports won't be collected
CApp will not build
DFirebase project won't be created
💡 Hint
Refer to key_moments about initialization importance and execution_table step 3.
Concept Snapshot
Crashlytics setup steps:
1. Add Firebase project
2. Add Crashlytics SDK to app
3. Initialize Crashlytics in app code
4. Build and run app
5. Crashlytics collects and uploads crash reports
6. View reports in Firebase Console
Initialization is key to activate crash capturing.
Full Transcript
To set up Crashlytics, first create and link a Firebase project. Then add the Crashlytics SDK to your app's dependencies. Next, initialize Crashlytics in your app code to enable crash capturing. Build and run the app so Crashlytics can start collecting crash data. When the app crashes, Crashlytics captures and uploads the report to Firebase. Finally, view the crash reports in the Firebase Console to monitor app stability. Initialization is essential; without it, crash data won't be collected.