error-tracking-android

Add PostHog error tracking to Android apps with Kotlin or Java.

58|5|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/PostHog/skills --skill error-tracking-android
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-tracking-android
Source: https://github.com/PostHog/skills/tree/main/skills/posthog/all/skills/error-tracking-android
Command: npx skills add https://github.com/PostHog/skills --skill error-tracking-android

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PostHog error tracking for Android helps you capture and monitor exceptions in Android applications, reducing debugging time and improving reliability.

Core Features & Use Cases

  • Autocapture first: Enable exception autocapture in the SDK initialization before adding manual captures.
  • Source maps: Upload source maps so stack traces resolve to original source code.
  • Manual capture: Use captureException() at error boundaries and catch blocks for errors that don't propagate to the global handler.

Quick Start

Install the PostHog Android SDK into your app, initialize it in your Application class's onCreate, and verify exceptions are captured.

Frequently Asked Questions about error-tracking-android

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Android error tracking with PostHog to my app?

Android error tracking with PostHog captures exceptions by initializing the SDK in your Application class's onCreate method. This setup enables automatic exception autocapture to monitor crashes in your Kotlin or Java app.

Does PostHog error tracking support both Kotlin and Java Android apps?

PostHog error tracking applies to Android apps built with Kotlin or Java. You initialize it once in Application.onCreate to enable automatic exception autocapture across both languages.

How do I upload source maps for accurate Android stack traces in PostHog?

You upload source maps by sending mapping files to PostHog, which resolves stack traces back to your original Android source code. This mapping file upload enables accurate stack trace fidelity for debugging.

When should I use manual exception capture instead of autocapture in Android?

Use manual exception capture with captureException() at error boundaries and catch blocks when errors do not propagate to the global handler. You should enable exception autocapture first before adding manual captures.

Do I need environment variables to initialize the PostHog Android SDK?

Yes, initializing the PostHog Android SDK enforces environment variable usage for your project keys and host. This configuration step secures your error tracking setup during Application.onCreate initialization.

What's the best way to monitor Android exceptions without missing caught errors?

The best way to monitor Android exceptions is enabling PostHog exception autocapture first, then adding manual captureException() calls inside catch blocks. This combination ensures both uncaught crashes and handled boundary errors are tracked.