Bird
Raised Fist0
Firebasecloud~20 mins

Crashlytics setup in Firebase - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Crashlytics Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate
2:00remaining
Crashlytics Initialization Behavior

After integrating Firebase Crashlytics into your app, what happens if the app crashes before Crashlytics finishes initializing?

AThe crash is recorded locally and sent to Firebase Crashlytics once initialization completes.
BThe crash is not recorded or reported to Firebase Crashlytics.
CThe app automatically restarts to complete Crashlytics initialization before reporting the crash.
DCrashlytics sends a partial crash report immediately, which is later completed.
Attempts:
2 left
💡 Hint

Think about what happens if the crash happens too early in the app lifecycle.

❓ Configuration
intermediate
2:00remaining
Correct Firebase Crashlytics Gradle Setup

Which of the following Gradle configurations correctly sets up Firebase Crashlytics in an Android app?

AApply plugin 'com.google.gms.google-services' only and add 'com.google.firebase:firebase-crashlytics' dependency in app-level build.gradle.
BAdd 'com.google.firebase:firebase-crashlytics' dependency only in project-level build.gradle without applying any plugin.
CApply plugin 'com.google.firebase.crashlytics' in app-level build.gradle and add 'com.google.firebase:firebase-crashlytics' dependency.
DAdd 'com.google.firebase:firebase-crashlytics' dependency in app-level build.gradle and apply plugin 'com.android.application' only.
Attempts:
2 left
💡 Hint

Remember that Crashlytics requires both a plugin and a dependency in the app module.

❓ security
advanced
2:00remaining
Crashlytics Data Privacy Compliance

Which practice ensures compliance with user privacy when using Firebase Crashlytics in your app?

AAvoid sending any user-identifiable information in crash reports and provide users with an option to opt out of crash reporting.
BAutomatically collect user location data in crash reports without user consent.
CDisable Crashlytics data encryption to speed up crash report delivery.
DSend all user data including personal identifiers in crash reports to help debugging.
Attempts:
2 left
💡 Hint

Think about respecting user privacy and legal regulations.

❓ Architecture
advanced
2:00remaining
Crashlytics Crash Report Flow

What is the correct sequence of steps for a crash report to be sent from a mobile app to the Firebase console using Crashlytics?

A2,1,3,4
B1,2,3,4
C2,3,1,4
D1,3,2,4
Attempts:
2 left
💡 Hint

Consider when Crashlytics can capture crashes and when it sends data.

✅ Best Practice
expert
2:00remaining
Optimizing Crashlytics for Minimal Impact

Which approach best minimizes the impact of Firebase Crashlytics on app startup time and user experience?

ASend crash reports immediately on app crash without waiting for next app launch.
BInitialize Crashlytics synchronously at the very start of app launch to capture all crashes immediately.
CDisable Crashlytics initialization entirely on slow devices to improve startup time.
DInitialize Crashlytics asynchronously after critical app components have loaded and disable automatic data collection until user consent is given.
Attempts:
2 left
💡 Hint

Think about balancing crash data collection with app performance and user privacy.

Practice

(1/5)
1. What is the primary purpose of Firebase Crashlytics in an app?
easy
A. To automatically detect and report app crashes
B. To store user data securely
C. To manage app user authentication
D. To optimize app performance speed

Solution

  1. Step 1: Understand Crashlytics function

    Crashlytics is designed to catch app crashes and send reports automatically to Firebase Console.
  2. Step 2: Compare with other Firebase features

    Other options like data storage, authentication, and performance are handled by different Firebase services.
  3. Final Answer:

    To automatically detect and report app crashes -> Option A
  4. Quick Check:

    Crashlytics = crash reporting [OK]
Hint: Crashlytics = crash reports, not data or auth [OK]
Common Mistakes:
  • Confusing Crashlytics with Firebase Authentication
  • Thinking Crashlytics manages user data
  • Assuming Crashlytics improves app speed
2. Which of the following is the correct step to initialize Crashlytics in an Android app's onCreate() method?
easy
A. FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
B. Crashlytics.initializeCrashlytics();
C. FirebaseApp.initializeApp(this);
D. Crashlytics.startCrashlyticsSession();

Solution

  1. Step 1: Identify correct Crashlytics initialization

    The official way to enable Crashlytics collection is calling FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);.
  2. Step 2: Check other options

    Crashlytics.initializeCrashlytics() and Crashlytics.startCrashlyticsSession() are not valid Firebase SDK methods. FirebaseApp.initializeApp(this); initializes Firebase but not Crashlytics specifically.
  3. Final Answer:

    FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true); -> Option A
  4. Quick Check:

    Enable Crashlytics with setCrashlyticsCollectionEnabled(true) [OK]
Hint: Use FirebaseCrashlytics.getInstance() to enable collection [OK]
Common Mistakes:
  • Using non-existent Crashlytics methods
  • Confusing FirebaseApp initialization with Crashlytics setup
  • Forgetting to enable crash collection explicitly
3. Given this Android code snippet, what will happen when the app runs?
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
crashlytics.log("User clicked button");
throw new RuntimeException("Test crash");
medium
A. The app logs the message but does not crash
B. The app ignores the exception and continues running
C. The app crashes silently without logging
D. The app logs the message and crashes, sending a report to Firebase

Solution

  1. Step 1: Analyze the code behavior

    The code logs a message to Crashlytics and then throws a RuntimeException, which causes the app to crash.
  2. Step 2: Understand Crashlytics reporting

    Crashlytics captures the log and crash, then sends the crash report to Firebase Console for analysis.
  3. Final Answer:

    The app logs the message and crashes, sending a report to Firebase -> Option D
  4. Quick Check:

    Crashlytics logs + crash = report sent [OK]
Hint: Throw exception after logging to test Crashlytics [OK]
Common Mistakes:
  • Thinking the app won't crash after exception
  • Assuming logs are not sent with crash
  • Believing the app ignores exceptions
4. You added Crashlytics to your iOS app but no crash reports appear in Firebase Console after forcing a crash. What is the most likely mistake?
medium
A. Calling Crashlytics.crash() before initializing Firebase
B. Forgetting to enable Crashlytics in Firebase Console
C. Not calling FirebaseApp.configure() in application(_:didFinishLaunchingWithOptions:)
D. Using an unsupported iOS version

Solution

  1. Step 1: Check Firebase initialization

    Calling FirebaseApp.configure() is required but usually done correctly if app runs.
  2. Step 2: Verify Crashlytics enablement in Console

    Crashlytics must be enabled in Firebase Console to receive reports; forgetting this is a common cause of missing reports.
  3. Step 3: Consider other options

    Calling crash before initialization or unsupported iOS versions are less common and usually cause app errors.
  4. Final Answer:

    Forgetting to enable Crashlytics in Firebase Console -> Option B
  5. Quick Check:

    Enable Crashlytics in Console to get reports [OK]
Hint: Always enable Crashlytics in Firebase Console after setup [OK]
Common Mistakes:
  • Skipping Crashlytics enablement in Firebase Console
  • Initializing Firebase incorrectly
  • Assuming all iOS versions are supported
5. You want to test Crashlytics setup by forcing a crash in your Android app. Which code snippet correctly triggers a test crash that will appear in Firebase Console?
hard
A. FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(false);
B. FirebaseCrashlytics.getInstance().log("Crash test");
C. throw new RuntimeException("Test Crash");
D. FirebaseCrashlytics.getInstance().recordException(new Exception("Test"));

Solution

  1. Step 1: Identify code that forces a crash

    Throwing a RuntimeException immediately crashes the app, which Crashlytics detects and reports.
  2. Step 2: Understand other options

    Logging or recording exceptions do not force a crash. Disabling collection prevents reporting.
  3. Final Answer:

    throw new RuntimeException("Test Crash"); -> Option C
  4. Quick Check:

    Throw exception to force crash for testing [OK]
Hint: Throw exception to force crash, not just log [OK]
Common Mistakes:
  • Using log or recordException without crashing
  • Disabling Crashlytics collection by mistake
  • Expecting logs alone to trigger crash reports
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard