Skip to main content
skill CX Codex

firebase-crashlytics · evanca — Claude Code skill: what it does, how to install

Skill teaches the agent to set up Firebase Crashlytics in Flutter projects: catch fatal and non-fatal errors, log async exceptions, add custom keys, and upload obfuscated build symbols.

MIT ★ 674 updated 2026-10-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rules
Open on GitHub

What firebase-crashlytics does

The skill explains how to capture errors from different sources: fatal ones via FlutterError.onError, async via PlatformDispatcher.instance.onError, isolate errors via addErrorListener. The agent will learn to add custom keys to reports (up to 64 pairs, each up to 1 kB), logs (64 kB limit per session), and user identifiers. Crashlytics keeps only the last eight non-fatal exceptions per session — older ones are dropped.

For obfuscated builds, the agent knows that iOS with Flutter 3.12.0+ and plugin 3.3.4+ uploads symbols automatically, while Android requires Firebase CLI version 11.9.0 or higher and the command firebase crashlytics:symbols:upload --app=FIREBASE_APP_ID PATH/TO/symbols. The skill shows how to disable data collection in debug mode via setCrashlyticsCollectionEnabled(false) and implement opt-in: by default, Crashlytics collects reports automatically, but you can disable automatic collection and enable it manually when the user consents — the setting persists across launches.

To verify the setup, the agent will call FirebaseCrashlytics.instance.crash(), rebuild the app in release mode, restart it, and check the Firebase Console dashboard within five minutes.

What it helps with

  • capture fatal Flutter errors and async exceptions
  • log isolate errors and record non-fatal exceptions with context
  • add custom keys, log messages, and user identifiers to reports
  • upload obfuscated build symbols for readable stack traces
  • configure opt-in data collection and disable Crashlytics in debug mode

Example prompts for the agent

  • Set up Firebase Crashlytics in the Flutter project and capture fatal errors via FlutterError.onError
  • Add a custom key user_action with value payment_completed to the Crashlytics report
  • Upload obfuscated Android build symbols to Crashlytics using Firebase CLI

How to install firebase-crashlytics

1Plugin marketplace

/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rules

This installs the whole flutter-ai-skills plugin with all its skills

2Skills CLI (Vercel)

npx skills add evanca/flutter-ai-rules --skill firebase-crashlytics -a claude-code

3Manually: put the files in place

~/.claude/skills/firebase-crashlytics/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/firebase-crashlytics/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about firebase-crashlytics

How to install firebase-crashlytics in Claude Code?

Run /plugin marketplace add evanca/flutter-ai-rules, then /plugin install flutter-ai-skills@flutter-ai-rules. The skill will appear in ~/.claude/skills/firebase-crashlytics/SKILL.md.

What does the firebase-crashlytics skill do?

Teaches the agent to set up Firebase Crashlytics in Flutter: catch fatal and non-fatal errors, log async exceptions, add custom keys, and upload obfuscated build symbols.

How many non-fatal exceptions does Crashlytics store?

Crashlytics stores only the last eight non-fatal exceptions per session. Older ones are automatically discarded.

Source text

SKILL.md · MIT
---
name: firebase-crashlytics
description: "Use when implementing crash reporting, capturing fatal/non-fatal errors, recording isolate/async exceptions, customizing reports, or uploading obfuscated symbols."
license: MIT
---

# Firebase Crashlytics Skill

This skill defines how to correctly use Firebase Crashlytics in Flutter applications.

## When to Use

Use this skill when:

* Implementing crash reporting in a Flutter project.
* Capturing fatal errors, non-fatal exceptions, and async/isolate errors.
* Customizing crash reports with keys, logs, and user identifiers.
* Configuring opt-in data collection or disabling reporting in debug builds.
* Uploading symbol files for obfuscated builds.

---

## 1. Setup and Configuration

```
flutter pub add firebase_crashlytics
flutter pub add firebase_analytics  # enables breadcrumb logs for better crash context
```

Run `flutterfire configure` to update the Firebase configuration and add the required Crashlytics Gradle plugin for Android.

```dart
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
```

**Obfuscated code:**
- For apps built with `--split-debug-info` and/or `--obfuscate`, upload symbol files for readable stack traces.
- **iOS:** Flutter 3.12.0+ and Crashlytics Flutter plugin 3.3.4+ handle symbol upload automatically.
- **Android:** Use Firebase CLI (v11.9.0+) to upload Flutter debug symbols:

```bash
firebase crashlytics:symbols:upload --app=FIREBASE_APP_ID PATH/TO/symbols
```

---

## 2. Error Handling

Configure comprehensive error capture in `main()` to catch errors from all sources:

**Fatal Flutter errors:**

```dart
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();

  // Pass all uncaught fatal errors from the framework to Crashlytics
  FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;

  // Catch async errors not handled by the Flutter framework
  PlatformDispatcher.instance.onError = (error, stack) {
    FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
    return true;
  };

  runApp(MyApp());
}
```

**Non-fatal Flutter errors:** use `recordFlutterError` instead of `recordFlutterFatalError`.

**Isolate errors:**

```dart
Isolate.current.addErrorListener(RawReceivePort((pair) async {
  final List<dynamic> errorAndStacktrace = pair;
  await FirebaseCrashlytics.instance.recordError(
    errorAndStacktrace.first,
    errorAndStacktrace.last,
    fatal: true,
  );
}).sendPort);
```

**Caught exceptions (non-fatal):**

```dart
await FirebaseCrashlytics.instance.recordError(
  error,
  stackTrace,
  reason: 'a non-fatal error',
  information: ['further diagnostic information about the error', 'version 2.0'],
);
```

- Crashlytics only stores the **most recent 8 non-fatal exceptions** per session — older ones are discarded.

---

## 3. Crash Report Customization

**Custom keys** (max 64 key/value pairs, up to 1 kB each):

```dart
FirebaseCrashlytics.instance.setCustomKey('str_key', 'hello');
FirebaseCrashlytics.instance.setCustomKey('bool_key', true);
FirebaseCrashlytics.instance.setCustomKey('int_key', 1);
```

**Custom log messages** (limit: 64 kB per session):

```dart
FirebaseCrashlytics.instance.log("User tapped on payment button");
```

**User identifier:**

```dart
FirebaseCrashlytics.instance.setUserIdentifier("user-123");
// Clear by setting to blank string
FirebaseCrashlytics.instance.setUserIdentifier("");
```

- Avoid putting unique values (user IDs, timestamps) directly in exception messages — use custom keys instead.

---

## 4. Performance and Optimization

- Crashlytics processes exceptions on a **dedicated background thread** to minimize performance impact.
- **Fatal** reports are sent in real-time without requiring an app restart.
- **Non-fatal** reports are written to disk and sent with the next fatal report or on app restart.
- Use breadcrumb logs (requires Firebase Analytics) to understand user actions leading up to a crash.

**Disable Crashlytics in debug builds:**

```dart
if (kReleaseMode) {
  await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
} else {
  await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(false);
}
```

---

## 5. Testing and Debugging

Force a test crash to verify the setup:

```dart
FirebaseCrashlytics.instance.crash();
```

**Verification workflow:**
1. Build and run the app in release mode.
2. Trigger the test crash.
3. Reopen the app so the crash report is uploaded.
4. Check the Firebase Console Crashlytics dashboard within 5 minutes.
5. Verify that custom keys, logs, and user identifiers appear on the crash report.

- Verify stack traces are properly symbolicated when using code obfuscation.

---

## 6. Opt-in Reporting

By default, Crashlytics automatically collects crash reports for all users.

To give users control over data collection:
- Disable automatic reporting and enable it only via `setCrashlyticsCollectionEnabled(true)` when users opt in.
- The override value **persists** across all subsequent app launches.
- To opt a user out, pass `false` — this applies from the next app launch.
- When disabled, crash info is **stored locally**; if later enabled, locally stored crashes are sent to Crashlytics.

---

## References

- [Firebase Crashlytics Flutter documentation](https://firebase.google.com/docs/crashlytics/get-started?platform=flutter)
- [Customize crash reports](https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=flutter)

© Ivanna Kaceviča · MIT · evanca/flutter-ai-rules

Similar skills

All skills for Mobile →

firebase-crashlytics by other authors comes first.

firebase-crashlytics Google LLC Guides Firebase Crashlytics provisioning and SDK setup. It covers crash reporting for Android, iOS, and Web apps. CX Codex +1 142,900installs firebase-ai-logic-basics Google LLC firebase-ai-logic-basics adds Firebase AI Logic to client apps across Android, iOS, Web, and Flutter to invoke Gemini models without spinning up a backend. CX Codex +1 146,900installs firebase-apk-scanner trailofbits firebase-apk-scanner unpacks an Android APK, pulls out its Firebase config and probes databases, buckets and functions for open access. Built for mobile app security audits. CX Codex +1 6,000installs firebase-development 2389-research firebase-development is a Claude Code plugin for Firebase project setup, feature work, debugging, and validation. ★ 106repo stars firebase-remote-config-basics Google LLC firebase-remote-config-basics manages Firebase Remote Config templates, loading strategies, and feature flags for Android and iOS. Helps tweak app behavior without pushing a release to app stores. CX Codex +1 132,400installs firebase-basics official google The firebase-basics skill sets up the Firebase CLI, handles sign-in, creates or switches projects, and downloads Android or iOS app configuration files. CX Codex +1 14,100installs ios-simulator callstack Launch, inspect, and debug native, React Native, Expo, and Flutter apps on iOS Simulator from your agent. The agent can tap, type, scroll, validate code changes, and collect error logs. CX Codex +1 7,000installs

From the same set39

The whole set →
testing The testing skill guides Flutter and Dart test writing and review, helps investigate flaky tests, and clarifies when to use unit or widget tests. CX Codex +1 ★ 674repo stars firebase-ai This skill gives the agent working patterns for wiring up Firebase AI Logic in a Flutter app and writing Gemini text and chat calls. CX Codex +1 ★ 674repo stars flutterfire-configure Guides Firebase integration in Flutter apps, runs flutterfire configure, and structures multi-flavor project environments. CX Codex +1 ★ 674repo stars flutter-use-column-row-first The flutter-use-column-row-first skill guides Flutter screen layouts with Row, Column, and flexible space. Use it when building a screen that must adapt to different constraints. CX Codex +1 ★ 674repo stars firebase-in-app-messaging Guides Firebase In-App Messaging setup in Flutter: trigger and suppress popups during sensitive flows, configure GDPR opt-in collection, and run tests via test device IDs. CX Codex +1 ★ 674repo stars firebase-analytics firebase-analytics is a Claude Code skill for configuring Firebase Analytics in Flutter apps. It activates for event logging, user properties, funnels, and screen-view tracking. CX Codex +1 ★ 674repo stars patrol-e2e-testing patrol-e2e-testing is a skill for building and running Patrol 4.x end-to-end tests for Flutter apps, covering user flows, OS permission dialogs and cross-platform checks. CX Codex +1 ★ 674repo stars revenuecat-testing revenuecat-testing builds a structured QA plan for RevenueCat in-app subscriptions, verifies sandbox events, and debugs purchase restore flows. CX Codex +1 ★ 674repo stars

Project sponsors

Companies that keep this analytics open