Official agent skill

Sentry Android SDK

by getsentry in getsentry/sentry-for-ai

Full Sentry SDK setup for Android. An agent skill from getsentry/sentry-for-ai.

OfficialApache-2.0Auto-check passedMobile

Install Sentry Android SDK

skills CLI
$ npx skills add getsentry/sentry-for-ai --skill sentry-android-sdk -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install getsentry/sentry-for-ai sentry-android-sdk --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/getsentry/sentry-for-ai.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills-legacy/sentry-android-sdk .claude/skills/sentry-android-sdk && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sentry-android-sdk
GitHub stars
268
Token cost
~7.7k tokens
SKILL.md length
1,955 words
Files
9 (incl. references)
Skills in repo
32
Repo updated
First seen
Licence
Apache-2.0

At a glance

Full Sentry SDK setup for Android. An agent skill from getsentry/sentry-for-ai.

  • Works in 4 steps: Detect → Recommend → Guide → …
  • Asked to add Sentry to Android
  • SKILL.md covers Invoke This Skill When, Phase 1: Detect, Phase 2: Recommend and Phase 3: Guide, plus 4 more sections
  • Needs SENTRY_AUTH_TOKEN

What it does

Sentry Android SDK is an agent skill from getsentry/sentry-for-ai, published by the product's own GitHub organization. Full Sentry SDK setup for Android. Use when asked to "add Sentry to Android", "install sentry-android", "setup Sentry in Android", or configure error monitoring, tracing, profiling, session replay, or logging for Android applications. Supports Kotlin and Java codebases.

Its SKILL.md is about 7.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including reference files (for example `references/crons.md`, `references/error-monitoring.md` and `references/integrations.md`).

It sits in Mobile, covering Android development. It works with Sentry, Android, Kotlin and Java. The repository describes itself as: Teach your AI coding assistant how to use Sentry - setup, debugging, alerts, and more. The licence is Apache-2.0.

When your agent uses it

  • Asked to add Sentry to Android
  • Install sentry-android
  • Setup Sentry in Android
  • Configure error monitoring

Example prompts

  • “add Sentry to Android”
  • “install sentry-android”
  • “setup Sentry in Android”
  • “/sentry-android-sdk”

Requirements

  • Node.js
  • A credential in SENTRY_AUTH_TOKEN

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Detect
  2. Recommend
  3. Guide
  4. Cross-Link

What it can do on your machine

Read from SKILL.md and the folder at commit d8fd106. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin, bash, groovy, xml, toml and java).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.sentry.io
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • SENTRY_AUTH_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sentry Android SDK loads about 7.7k tokens when it runs, and up to ~38k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 1,955 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~7.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~38k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from getsentry/sentry-for-ai at commit d8fd106, republished under its Apache-2.0 licence (© getsentry). 1,955 words, ~7,671 tokens.

Download SKILL.mdSave it as .claude/skills/sentry-android-sdk/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
sentry-android-sdk
description
Full Sentry SDK setup for Android. Use when asked to "add Sentry to Android", "install sentry-android", "setup Sentry in Android", or configure error monitoring, tracing, profiling, session replay, or logging for Android applications. Supports Kotlin and Java codebases.
license
Apache-2.0
category
sdk-setup
parent
sentry-sdk-setup
disable-model-invocation
true

All Skills > SDK Setup > Android SDK

Sentry Android SDK

Opinionated wizard that scans your Android project and guides you through complete Sentry setup — error monitoring, tracing, profiling, session replay, logging, and more.

Invoke This Skill When

  • User asks to "add Sentry to Android" or "set up Sentry" in an Android app
  • User wants error monitoring, crash reporting, ANR detection, tracing, profiling, session replay, or logging in Android
  • User mentions sentry-android, io.sentry:sentry-android, mobile crash tracking, or Sentry for Kotlin/Java Android
  • User wants to monitor native (NDK) crashes, application not responding (ANR) events, or app startup performance

Note: SDK versions and APIs below reflect current Sentry docs at time of writing (io.sentry:sentry-android:8.33.0, Gradle plugin 6.1.0). Always verify against docs.sentry.io/platforms/android/ before implementing.


Phase 1: Detect

Run these commands to understand the project before making any recommendations:

bash
# Detect project structure and build system
ls build.gradle build.gradle.kts settings.gradle settings.gradle.kts 2>/dev/null

# Check AGP version and existing Sentry
grep -r '"com.android.application"' build.gradle* app/build.gradle* 2>/dev/null | head -3
grep -ri sentry build.gradle* app/build.gradle* 2>/dev/null | head -10

# Check app-level build file (Groovy vs KTS)
ls app/build.gradle app/build.gradle.kts 2>/dev/null

# Detect Gradle version catalog (libs.versions.toml) — modern AGP projects
ls gradle/libs.versions.toml 2>/dev/null

# Check for existing Sentry entries in the version catalog
grep -iE 'sentry|io\.sentry' gradle/libs.versions.toml 2>/dev/null | head -10

# Check if build files reference the catalog (alias/libs.* usage)
grep -E 'alias\(libs\.|libs\.[a-zA-Z]' build.gradle build.gradle.kts app/build.gradle app/build.gradle.kts 2>/dev/null | head -5

# Detect Kotlin vs Java
find app/src/main -name "*.kt" 2>/dev/null | head -3
find app/src/main -name "*.java" 2>/dev/null | head -3

# Check minSdk, targetSdk
grep -E 'minSdk|targetSdk|compileSdk|minSdkVersion|targetSdkVersion' app/build.gradle app/build.gradle.kts 2>/dev/null | head -6

# Detect Jetpack Compose
grep -E 'compose|androidx.compose' app/build.gradle app/build.gradle.kts 2>/dev/null | head -5

# Detect OkHttp (popular HTTP client — has dedicated integration)
grep -E 'okhttp|retrofit' app/build.gradle app/build.gradle.kts 2>/dev/null | head -3

# Detect Room or SQLite
grep -E 'androidx.room|androidx.sqlite' app/build.gradle app/build.gradle.kts 2>/dev/null | head -3

# Detect Timber (logging library)
grep -E 'timber' app/build.gradle app/build.gradle.kts 2>/dev/null | head -3

# Detect Jetpack Navigation
grep -E 'androidx.navigation' app/build.gradle app/build.gradle.kts 2>/dev/null | head -3

# Detect Apollo (GraphQL)
grep -E 'apollo' app/build.gradle app/build.gradle.kts 2>/dev/null | head -3

# Check existing Sentry initialization
grep -r "SentryAndroid.init\|io.sentry.Sentry" app/src/ 2>/dev/null | head -5

# Check Application class
find app/src/main -name "*.kt" -o -name "*.java" 2>/dev/null | xargs grep -l "Application()" 2>/dev/null | head -3

# Adjacent backend (for cross-linking)
ls ../backend ../server ../api 2>/dev/null
find .. -maxdepth 2 \( -name "go.mod" -o -name "requirements.txt" -o -name "Gemfile" \) 2>/dev/null | grep -v node_modules | head -5

What to determine:

QuestionImpact
build.gradle.kts present?Use Kotlin DSL syntax in all examples
gradle/libs.versions.toml present?Add Sentry to the version catalog; reference via libs.* in build files
Catalog already has sentry entries?Reuse the existing version ref; don't duplicate or hardcode versions
minSdk < 26?Note Session Replay requires API 26+ — silent no-op below that
Compose detected?Recommend sentry-compose-android and Compose-specific masking
OkHttp present?Recommend sentry-okhttp interceptor or Gradle plugin bytecode auto-instrumentation
Room/SQLite present?Recommend sentry-android-sqlite or plugin bytecode instrumentation
Timber present?Recommend sentry-android-timber integration
Jetpack Navigation?Recommend sentry-android-navigation for screen tracking
Already has SentryAndroid.init()?Skip install, jump to feature config
Application subclass exists?That's where SentryAndroid.init() goes

Phase 2: Recommend

Present a concrete recommendation based on what you found. Don't ask open-ended questions — lead with a proposal:

Recommended (core coverage — always set up these):

  • ✅ Error Monitoring — captures uncaught exceptions, ANRs, and native NDK crashes automatically
  • ✅ Tracing — auto-instruments Activity lifecycle, app start, HTTP requests, and database queries
  • ✅ Session Replay — records screen captures and user interactions for debugging (API 26+)

Optional (enhanced observability):

  • ⚡ Profiling — continuous UI profiling (recommended) or transaction-based sampling
  • ⚡ Logging — structured logs via Sentry.logger(), with optional Timber bridge
  • ⚡ User Feedback — collect user-submitted bug reports from inside the app

Recommendation logic:

FeatureRecommend when...
Error MonitoringAlways — non-negotiable baseline for any Android app
TracingAlways for Android — app start time, Activity lifecycle, network latency matter
Session ReplayUser-facing production app on API 26+; visual debugging of user issues
ProfilingPerformance-sensitive apps, startup time investigations, production perf analysis
LoggingApp uses structured logging or you want log-to-trace correlation in Sentry
User FeedbackBeta or customer-facing app where you want user-submitted bug reports

Propose: "For your [Kotlin / Java] Android app (minSdk X), I recommend setting up Error Monitoring + Tracing + Session Replay. Want me to also add Profiling and Logging?"


Phase 3: Guide

Determine Your Setup Path
Project typeRecommended setupComplexity
New project, no existing SentryGradle plugin (recommended)Low — plugin handles most config
Existing project, no SentryGradle plugin or manual initMedium — add dependency + Application class
Manual full controlSentryAndroid.init() in ApplicationMedium — explicit config, most flexible

You need to run this yourself — the wizard opens a browser for login and requires interactive input that the agent can't handle. Copy-paste into your terminal:

npx @sentry/wizard@latest -i android

It handles login, org/project selection, Gradle plugin setup, dependency installation, DSN configuration, and ProGuard/R8 mapping upload.

Once it finishes, come back and skip to Verification.

If the user skips the wizard, proceed with Option 2 (Manual Setup) below.


Option 2: Manual Setup
Using a Gradle Version Catalog (gradle/libs.versions.toml)

If Phase 1 detected gradle/libs.versions.toml, add Sentry to the catalog first, then reference it from your build files. This keeps versions centralized and matches modern AGP project conventions.

Step 1 — Add entries to gradle/libs.versions.toml

toml
[versions]
sentry = "8.33.0"
sentryGradlePlugin = "6.1.0"

[libraries]
sentry-android = { module = "io.sentry:sentry-android", version.ref = "sentry" }
sentry-bom = { module = "io.sentry:sentry-bom", version.ref = "sentry" }
# Optional integrations — add only the ones your project uses:
sentry-android-timber = { module = "io.sentry:sentry-android-timber" }
sentry-android-fragment = { module = "io.sentry:sentry-android-fragment" }
sentry-compose-android = { module = "io.sentry:sentry-compose-android" }
sentry-android-navigation = { module = "io.sentry:sentry-android-navigation" }
sentry-okhttp = { module = "io.sentry:sentry-okhttp" }
sentry-android-sqlite = { module = "io.sentry:sentry-android-sqlite" }
sentry-kotlin-extensions = { module = "io.sentry:sentry-kotlin-extensions" }

[plugins]
sentry-android-gradle = { id = "io.sentry.android.gradle", version.ref = "sentryGradlePlugin" }

Note: Optional integration entries omit version.ref — their versions come from the BOM at resolution time. Only sentry-bom needs the version ref. If the catalog already defines a sentry version, reuse it instead of adding a duplicate entry.

Step 2 — Reference the catalog from build.gradle[.kts]

Project-level build.gradle.kts:

kotlin
plugins {
    alias(libs.plugins.sentry.android.gradle) apply false
}

App-level app/build.gradle.kts:

kotlin
plugins {
    id("com.android.application")
    alias(libs.plugins.sentry.android.gradle)
}

dependencies {
    implementation(platform(libs.sentry.bom))
    implementation(libs.sentry.android)
    // implementation(libs.sentry.okhttp)
    // implementation(libs.sentry.compose.android)
}

Groovy DSL (app/build.gradle) equivalent:

groovy
plugins {
    id "com.android.application"
    alias libs.plugins.sentry.android.gradle
}

dependencies {
    implementation platform(libs.sentry.bom)
    implementation libs.sentry.android
}

Then continue with the sentry {} configuration block from Path A, Step 2 below. The rest of the setup (Application class init, manifest registration, verification) is identical.


The Sentry Gradle plugin is the easiest setup path. It:

  • Uploads ProGuard/R8 mapping files automatically on release builds
  • Injects source context into stack frames
  • Optionally instruments OkHttp, Room/SQLite, File I/O, Compose navigation, and android.util.Log via bytecode transforms (zero source changes)

Step 1 — Add the plugin to build.gradle[.kts] (project-level)

Groovy DSL (build.gradle):

groovy
plugins {
    id "io.sentry.android.gradle" version "6.1.0" apply false
}

Kotlin DSL (build.gradle.kts):

kotlin
plugins {
    id("io.sentry.android.gradle") version "6.1.0" apply false
}

Step 2 — Apply plugin + add dependencies in app/build.gradle[.kts]

Groovy DSL:

groovy
plugins {
    id "com.android.application"
    id "io.sentry.android.gradle"
}

android {
    // ...
}

dependencies {
    // Use BOM for consistent versions across sentry modules
    implementation platform("io.sentry:sentry-bom:8.33.0")
    implementation "io.sentry:sentry-android"

    // Optional integrations (add what's relevant):
    // implementation "io.sentry:sentry-android-timber"     // Timber bridge
    // implementation "io.sentry:sentry-android-fragment"   // Fragment lifecycle tracing
    // implementation "io.sentry:sentry-compose-android"    // Jetpack Compose support
    // implementation "io.sentry:sentry-android-navigation"  // Jetpack Navigation
    // implementation "io.sentry:sentry-okhttp"             // OkHttp interceptor
    // implementation "io.sentry:sentry-android-sqlite"     // Room/SQLite tracing
    // implementation "io.sentry:sentry-kotlin-extensions"  // Coroutine context propagation
}

sentry {
    org = "YOUR_ORG_SLUG"
    projectName = "YOUR_PROJECT_SLUG"
    authToken = System.getenv("SENTRY_AUTH_TOKEN")

    // Enable auto-instrumentation via bytecode transforms (no source changes needed)
    tracingInstrumentation {
        enabled = true
        features = [InstrumentationFeature.DATABASE, InstrumentationFeature.FILE_IO,
                    InstrumentationFeature.OKHTTP, InstrumentationFeature.COMPOSE]
    }

    // Upload ProGuard mapping and source context on release
    autoUploadProguardMapping = true
    includeSourceContext = true
}

Kotlin DSL (app/build.gradle.kts):

kotlin
plugins {
    id("com.android.application")
    id("io.sentry.android.gradle")
}

dependencies {
    implementation(platform("io.sentry:sentry-bom:8.33.0"))
    implementation("io.sentry:sentry-android")

    // Optional integrations:
    // implementation("io.sentry:sentry-android-timber")
    // implementation("io.sentry:sentry-android-fragment")
    // implementation("io.sentry:sentry-compose-android")
    // implementation("io.sentry:sentry-android-navigation")
    // implementation("io.sentry:sentry-okhttp")
    // implementation("io.sentry:sentry-android-sqlite")
    // implementation("io.sentry:sentry-kotlin-extensions")
}

sentry {
    org = "YOUR_ORG_SLUG"
    projectName = "YOUR_PROJECT_SLUG"
    authToken = System.getenv("SENTRY_AUTH_TOKEN")

    tracingInstrumentation {
        enabled = true
        features = setOf(
            InstrumentationFeature.DATABASE,
            InstrumentationFeature.FILE_IO,
            InstrumentationFeature.OKHTTP,
            InstrumentationFeature.COMPOSE,
        )
    }

    autoUploadProguardMapping = true
    includeSourceContext = true
}

Step 3 — Initialize Sentry in your Application class

If you don't have an Application subclass, create one:

kotlin
// MyApplication.kt
import android.app.Application
import io.sentry.SentryLevel
import io.sentry.android.core.SentryAndroid
import io.sentry.android.replay.SentryReplayOptions

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        SentryAndroid.init(this) { options ->
            options.dsn = "YOUR_SENTRY_DSN"

            // Tracing — lower to 0.1–0.2 in high-traffic production
            options.tracesSampleRate = 1.0

            // Profiling — use continuous UI profiling (recommended, SDK ≥ 8.7.0)
            options.profileSessionSampleRate = 1.0

            // Session Replay (API 26+ only; silent no-op below API 26)
            options.sessionReplay.sessionSampleRate = 0.1    // 10% of all sessions
            options.sessionReplay.onErrorSampleRate = 1.0    // 100% on error

            // Structured logging
            options.logs.isEnabled = true

            // Environment
            options.environment = BuildConfig.BUILD_TYPE
        }
    }
}

Java equivalent:

java
// MyApplication.java
import android.app.Application;
import io.sentry.android.core.SentryAndroid;

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        SentryAndroid.init(this, options -> {
            options.setDsn("YOUR_SENTRY_DSN");
            options.setTracesSampleRate(1.0);
            options.setProfileSessionSampleRate(1.0);
            options.getSessionReplay().setSessionSampleRate(0.1);
            options.getSessionReplay().setOnErrorSampleRate(1.0);
            options.getLogs().setEnabled(true);
            options.setEnvironment(BuildConfig.BUILD_TYPE);
        });
    }
}

Step 4 — Register Application in AndroidManifest.xml

xml
<application
    android:name=".MyApplication"
    ... >

Path B: Manual Setup (No Gradle Plugin)

Use this if you can't use the Gradle plugin (e.g., non-standard build setups).

Step 1 — Add dependency in app/build.gradle[.kts]

kotlin
dependencies {
    implementation(platform("io.sentry:sentry-bom:8.33.0"))
    implementation("io.sentry:sentry-android")
}

Step 2 — Initialize in Application class (same as Path A, Step 3)

Step 3 — Configure ProGuard/R8 manually

The Sentry SDK ships a ProGuard rules file automatically. For manual mapping upload, install sentry-cli and add to your CI:

bash
sentry-cli releases files "my-app@1.0.0+42" upload-proguard \
  --org YOUR_ORG --project YOUR_PROJECT \
  app/build/outputs/mapping/release/mapping.txt

kotlin
SentryAndroid.init(this) { options ->
    options.dsn = "YOUR_SENTRY_DSN"

    // Environment and release
    options.environment = BuildConfig.BUILD_TYPE     // "debug", "release", etc.
    options.release = "${BuildConfig.APPLICATION_ID}@${BuildConfig.VERSION_NAME}+${BuildConfig.VERSION_CODE}"

    // Tracing — sample 100% in dev, lower to 10–20% in production
    options.tracesSampleRate = 1.0

    // Continuous UI profiling (recommended over transaction-based)
    options.profileSessionSampleRate = 1.0

    // Session Replay (API 26+; silent no-op on API 21–25)
    options.sessionReplay.sessionSampleRate = 0.1
    options.sessionReplay.onErrorSampleRate = 1.0
    options.sessionReplay.maskAllText = true         // mask text for privacy
    options.sessionReplay.maskAllImages = true       // mask images for privacy

    // Structured logging
    options.logs.isEnabled = true

    // Error enrichment
    options.isAttachScreenshot = true                // capture screenshot on error
    options.isAttachViewHierarchy = true             // attach view hierarchy JSON

    // ANR detection (5s default; watchdog + ApplicationExitInfo API 30+)
    options.isAnrEnabled = true

    // NDK native crash handling (enabled by default)
    options.isEnableNdk = true

    // Send PII: IP address, user data
    options.sendDefaultPii = true

    // Trace propagation (backend distributed tracing)
    options.tracePropagationTargets = listOf("api.yourapp.com", ".*\\.yourapp\\.com")

    // Verbose logging — disable in production
    options.isDebug = BuildConfig.DEBUG
}

For Each Agreed Feature

Walk through features one at a time. Load the reference file for each, follow its steps, then verify before moving on:

FeatureReferenceLoad when...
Error Monitoring${SKILL_ROOT}/references/error-monitoring.mdAlways (baseline)
Tracing & Performance${SKILL_ROOT}/references/tracing.mdAlways for Android (Activity lifecycle, network)
Profiling${SKILL_ROOT}/references/profiling.mdPerformance-sensitive production apps
Session Replay${SKILL_ROOT}/references/session-replay.mdUser-facing apps (API 26+)
Logging${SKILL_ROOT}/references/logging.mdStructured logging / log-to-trace correlation
Metrics${SKILL_ROOT}/references/metrics.mdCustom metric tracking (SDK ≥ 8.30.0)
Crons${SKILL_ROOT}/references/crons.mdScheduled jobs, WorkManager check-ins
Integration Reference${SKILL_ROOT}/references/integrations.mdBuilt-in, optional, and Gradle bytecode integrations

For each feature: Read ${SKILL_ROOT}/references/<feature>.md, follow steps exactly, verify it works.


Configuration Reference

Core SentryOptions (via SentryAndroid.init)
OptionTypeDefaultPurpose
dsnString—Required. Project DSN; SDK silently disabled if empty
environmentString—e.g., "production", "staging". Env: SENTRY_ENVIRONMENT
releaseString—App version, e.g., "my-app@1.0.0+42". Env: SENTRY_RELEASE
distString—Build variant / distribution identifier
sendDefaultPiiBooleanfalseInclude PII: IP address, user data
sampleRateDouble1.0Error event sampling (0.0–1.0)
maxBreadcrumbsInt100Max breadcrumbs per event
isAttachStacktraceBooleantrueAuto-attach stack traces to message events
isAttachScreenshotBooleanfalseCapture screenshot on error
isAttachViewHierarchyBooleanfalseAttach JSON view hierarchy as attachment
isDebugBooleanfalseVerbose SDK output. Never use in production
isEnabledBooleantrueDisable SDK entirely (e.g., for testing)
beforeSendSentryOptions.BeforeSendCallback—Modify or drop error events before sending
beforeBreadcrumbSentryOptions.BeforeBreadcrumbCallback—Filter breadcrumbs before storage
Tracing Options
OptionTypeDefaultPurpose
tracesSampleRateDouble0.0Transaction sample rate (0–1). Use 1.0 in dev
tracesSamplerTracesSamplerCallback—Per-transaction sampling; overrides tracesSampleRate
tracePropagationTargetsList<String>[".*"]Hosts/URLs to receive sentry-trace and baggage headers
isEnableAutoActivityLifecycleTracingBooleantrueAuto-instrument Activity lifecycle
isEnableTimeToFullDisplayTracingBooleanfalseTTFD spans (requires Sentry.reportFullyDisplayed())
isEnableUserInteractionTracingBooleanfalseAuto-instrument user gestures as transactions
Profiling Options
OptionTypeDefaultPurpose
profileSessionSampleRateDouble0.0Continuous profiling sample rate (SDK ≥ 8.7.0, API 22+)
profilesSampleRateDouble0.0Legacy transaction profiling rate (mutually exclusive with continuous)
isProfilingStartOnAppStartBooleanfalseAuto-start profiling session on app launch
ANR Options
OptionTypeDefaultPurpose
isAnrEnabledBooleantrueEnable ANR watchdog thread
anrTimeoutIntervalMillisLong5000Milliseconds before reporting ANR
isAnrReportInDebugBooleanfalseReport ANRs in debug builds (noisy in debugger)
Show full SKILL.md (779 more words)Show less
NDK Options
OptionTypeDefaultPurpose
isEnableNdkBooleantrueEnable native crash capture via sentry-native
isEnableScopeSyncBooleantrueSync Java scope (user, tags) to NDK layer
isEnableTombstoneFetchJobBooleantrueFetch NDK tombstone files for enrichment
Session Replay Options (options.sessionReplay)
OptionTypeDefaultPurpose
sessionSampleRateDouble0.0Fraction of all sessions to record
onErrorSampleRateDouble0.0Fraction of error sessions to record
maskAllTextBooleantrueMask all text in replays
maskAllImagesBooleantrueMask all images in replays
qualitySentryReplayQualityMEDIUMVideo quality: LOW, MEDIUM, HIGH
Logging Options (options.logs)
OptionTypeDefaultPurpose
isEnabledBooleanfalseEnable Sentry.logger() API (SDK ≥ 8.12.0)
setBeforeSendBeforeSendLogCallback—Filter/modify log entries before sending
Environment Variables
VariablePurposeNotes
SENTRY_DSNData Source NameSet in CI; SDK reads from environment at init
SENTRY_AUTH_TOKENUpload ProGuard mappings and source contextNever commit — use CI/CD secrets
SENTRY_ORGOrganization slugUsed by Gradle plugin sentry.org
SENTRY_PROJECTProject slugUsed by Gradle plugin sentry.projectName
SENTRY_RELEASERelease identifierFalls back from options.release
SENTRY_ENVIRONMENTEnvironment nameFalls back from options.environment

You can also configure DSN and many options via AndroidManifest.xml meta-data:

xml
<application>
    <meta-data android:name="io.sentry.dsn" android:value="YOUR_DSN" />
    <meta-data android:name="io.sentry.traces-sample-rate" android:value="1.0" />
    <meta-data android:name="io.sentry.environment" android:value="production" />
    <meta-data android:name="io.sentry.anr.enable" android:value="true" />
    <meta-data android:name="io.sentry.attach-screenshot" android:value="true" />
    <meta-data android:name="io.sentry.attach-view-hierarchy" android:value="true" />
</application>

⚠️ Manifest meta-data is a convenient alternative but does not support the full option set. For complex configuration (session replay, profiling, hooks), use SentryAndroid.init().


Verification

After setup, verify Sentry is receiving events:

Test error capture:

kotlin
// In an Activity or Fragment
try {
    throw RuntimeException("Sentry Android SDK test")
} catch (e: Exception) {
    Sentry.captureException(e)
}

Test tracing:

kotlin
val transaction = Sentry.startTransaction("test-task", "task")
val span = transaction.startChild("test-span", "description")
span.finish()
transaction.finish()

Test structured logging (SDK ≥ 8.12.0):

kotlin
Sentry.logger().info("Sentry logging test")
Sentry.logger().error("Error log test", Exception("test error"))

Check the Sentry dashboard:

  • Issues → your test exception should appear within seconds
  • Traces → look for test-task transaction with child span
  • Replays → session recording visible after app interaction (requires API 26+)
  • Logs → structured log entries visible under Logs tab

If nothing appears:

  1. Set options.isDebug = true — SDK logs to Logcat
  2. Verify DSN is correct and matches your Sentry project
  3. Check that your Application class is registered in AndroidManifest.xml as android:name
  4. Confirm the device/emulator has internet connectivity
  5. For NDK crashes, ensure isEnableNdk = true (default) and build with NDK support

After completing Android setup, check for a backend or web frontend missing Sentry coverage:

bash
# Adjacent backend directories
ls ../backend ../server ../api 2>/dev/null
cat ../go.mod 2>/dev/null | head -3
cat ../requirements.txt ../pyproject.toml 2>/dev/null | head -5
cat ../Gemfile 2>/dev/null | head -3
ls ../backend/package.json ../server/package.json 2>/dev/null

# iOS counterpart app
ls ../ios ../YourApp-iOS 2>/dev/null
find .. -maxdepth 3 -name "*.xcodeproj" 2>/dev/null | head -3

If a backend or related platform exists without Sentry, suggest the matching skill:

DetectedSuggest skill
Go backend (go.mod)sentry-go-sdk
Python backend (requirements.txt, pyproject.toml)sentry-python-sdk
Ruby backend (Gemfile)sentry-ruby-sdk
Node.js backend@sentry/node — see docs.sentry.io/platforms/javascript/guides/express/
iOS app (.xcodeproj)sentry-cocoa-sdk
React Native (package.json with react-native)sentry-react-native-sdk
React / Next.js websentry-react-sdk or sentry-nextjs-sdk

Distributed tracing setup — if the backend skill is added, configure tracePropagationTargets in Android to propagate trace context to your API:

kotlin
options.tracePropagationTargets = listOf(
    "api.yourapp.com",
    ".*\\.yourapp\\.com"
)

This links mobile transactions to backend traces in the Sentry waterfall view.


Troubleshooting

IssueSolution
Events not appearing in SentrySet isDebug = true, check Logcat for SDK errors; verify DSN is correct and matches your project
SentryAndroid.init() not calledConfirm android:name=".MyApplication" is set in AndroidManifest.xml; Application class not abstract
Gradle plugin not foundAdd the plugin to project-level build.gradle.kts first, then apply false; verify version 6.1.0
ProGuard mapping not uploadingSet SENTRY_AUTH_TOKEN env var; ensure autoUploadProguardMapping = true in sentry {} block
NDK crashes not capturedVerify isEnableNdk = true (default); ensure project has NDK configured in android.ndkVersion
ANR reported in debuggerSet isAnrReportInDebug = false (default); ANR watchdog fires when debugger pauses threads
Session replay not recordingRequires API 26+; verify sessionSampleRate > 0 or onErrorSampleRate > 0; check Logcat for replay errors
Session replay shows blank screenPixelCopy (default) requires hardware acceleration; try SentryReplayOptions.screenshotQuality = CANVAS
Replay masking misalignedViews with translationX/Y or clipToPadding=false can offset masks; report to github.com/getsentry/sentry-java
beforeSend not firingbeforeSend only intercepts managed (Java/Kotlin) events; NDK native crashes bypass it
OkHttp spans not appearingAdd SentryOkHttpInterceptor to your OkHttpClient, or use Gradle plugin OKHTTP bytecode instrumentation
Spans not attached to transactionEnsure TransactionOptions().setBindToScope(true) when starting transaction; child spans look for scope root
Tracing not recordingVerify tracesSampleRate > 0; Activity instrumentation requires isEnableAutoActivityLifecycleTracing = true (default)
Continuous profiling not workingSDK ≥ 8.7.0 required; API 22+ required; set profileSessionSampleRate > 0; don't also set profilesSampleRate
Both profiling modes setprofilesSampleRate and profileSessionSampleRate are mutually exclusive — use only one
TTFD spans missingSet isEnableTimeToFullDisplayTracing = true and call Sentry.reportFullyDisplayed() when screen is ready
Kotlin coroutine scope lostAdd sentry-kotlin-extensions dependency; use Sentry.cloneMainContext() to propagate trace context
Release build stack traces unreadableProGuard mapping not uploaded; confirm Gradle plugin autoUploadProguardMapping = true and auth token set
Source context not showing in SentryEnable includeSourceContext = true in sentry {} block (Gradle plugin required)
BOM version conflictUse implementation(platform("io.sentry:sentry-bom:8.33.0")) and omit versions from all other io.sentry:* entries
Version catalog alias unresolvedAfter editing gradle/libs.versions.toml, sync Gradle; alias names use - in TOML and . in build files (e.g., sentry-android → libs.sentry.android)
Duplicate Sentry version in catalogReuse the existing [versions] sentry = "..." entry; don't add a second key, and don't hardcode the version in build.gradle when the catalog is in use
SENTRY_AUTH_TOKEN exposedAuth token is build-time only — never pass it to SentryAndroid.init() or embed in the APK

© getsentry, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (references) in skills-legacy/sentry-android-sdk of getsentry/sentry-for-ai.

  • SKILL.md
  • references/crons.md
  • references/error-monitoring.md
  • references/integrations.md
  • references/logging.md
  • references/metrics.md
  • references/profiling.md
  • references/session-replay.md
  • references/tracing.md

Open the folder on GitHubat commit d8fd106

Compare with similar skills

Sentry Android SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sentry Android SDK compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sentry Android SDK this skillgetsentry/sentry-for-ai268—~7.7kAutomated safety check: PassApache-2.0
Android Audio E2Ehyochan/react-native-nitro-sound961—~814Automated safety check: PassMIT
Apc BuildJoker-x-dev/AndroidProject-Compose102—~553Automated safety check: PassNone
Dt Setup AndroidDynatrace/dynatrace-for-ai161—~3.5kAutomated safety check: PassApache-2.0
Android DevOpenMinis/MinisSkills440—~1.9kAutomated safety check: PassMIT
Android API Diffgkd-kit/gkd43k—~796Automated safety check: PassGPL-3.0

Similar skills

  • Android Audio E2E

    hyochan/react-native-nitro-sound

    Build and run device-backed Android end-to-end checks for react-native-nitro-sound permissions, recording, playback, listeners, pause/resume, seek, speed, audio focus, lifecycle behavior, and rapid…

    961 GitHub stars~814 tokensUpdated 7 days ago
    MobileAuto-check passed
  • Apc Build

    Joker-x-dev/AndroidProject-Compose

    管理 AndroidProject-Compose 的 Gradle、版本目录、SDK、BuildConfig、构建类型、ABI、签名、混淆、应用资源和 APK/AAB 发布流程。用户要求升级依赖、修改构建配置、替换图标或启动页、配置签名、排查构建失败、缩减包体或生成发布包时使用。

    102 GitHub stars~553 tokensUpdated 21 days ago
    MobileAuto-check passed
  • Dt Setup Android

    Dynatrace/dynatrace-for-ai

    Instruments an existing Android project (Kotlin or Java) with the Dynatrace Mobile Agent for basic monitoring.

    161 GitHub stars~3.5k tokensUpdated 6 days ago
    MobileAuto-check passed
  • Android Dev

    OpenMinis/MinisSkills

    在 Minis 的 ARM64 Alpine PRoot 中从零诊断、安装并验证 Android 构建环境,以及创建、构建、签名验证、安装和启动原生 Android App;覆盖 Java/Kotlin/Gradle/SDK/AAPT2、APK、ADB/无线调试/Shizuku,以及条件式 JNI/NDK。用户提到 Android…

    440 GitHub stars~1.9k tokensUpdated 2 days ago
    MobileAuto-check passed
  • Android API Diff

    gkd-kit/gkd

    Looks up Android framework Java and AIDL APIs across versions with the android-api-diff CLI: signatures, availability, source files and hidden-API access code.

    43k GitHub stars~796 tokensUpdated today
    MobileAuto-check passed
  • Android Development

    dpconde/claude-android-skill

    Create production-quality Android applications following Google's official architecture guidance and NowInAndroid best practices.

    336 GitHub stars~1.7k tokensUpdated 10 mo ago
    MobileAuto-check passed

More from getsentry/sentry-for-ai

All 32 skills in this repo
  • Sentry Elixir SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for Elixir. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~3.5k tokensUpdated today
    Auto-check passed
  • Sentry Go SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for Go. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Sentry Nextjs SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for Next.js. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~4.7k tokensUpdated today
    Auto-check: notes
  • Sentry Php SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for PHP. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~3.7k tokensUpdated today
    Auto-check: notes
  • Sentry Python SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for Python. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Sentry React Router Framework SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for React Router Framework mode. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~3.8k tokensUpdated today
    Auto-check: notes

Categories

Questions about Sentry Android SDK

What does Sentry Android SDK do?

Full Sentry SDK setup for Android. An agent skill from getsentry/sentry-for-ai. Sentry Android SDK is an agent skill from getsentry/sentry-for-ai, published by the product's own GitHub organization. Full Sentry SDK setup for Android.

When should I use Sentry Android SDK?

Sentry Android SDK fits situations like: asked to add Sentry to Android; install sentry-android; setup Sentry in Android; configure error monitoring.

How do I install Sentry Android SDK in Claude Code?

Run `npx skills add getsentry/sentry-for-ai --skill sentry-android-sdk -a claude-code`. Or copy the skill folder (skills-legacy/sentry-android-sdk in getsentry/sentry-for-ai) into .claude/skills/sentry-android-sdk in your project. Claude Code loads it when a task matches its description.

How do I install Sentry Android SDK in Codex?

Run `npx skills add getsentry/sentry-for-ai --skill sentry-android-sdk -a codex`. Or copy the skill folder (skills-legacy/sentry-android-sdk in getsentry/sentry-for-ai) into .agents/skills/sentry-android-sdk in your project. Codex loads it when a task matches its description.

Can I use Sentry Android SDK in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add getsentry/sentry-for-ai --skill sentry-android-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sentry-android-sdk, .gemini/skills/sentry-android-sdk, .github/skills/sentry-android-sdk and .opencode/skills/sentry-android-sdk in your project.

What does Sentry Android SDK need to run?

Going by SKILL.md and its folder, Sentry Android SDK needs credentials named SENTRY_AUTH_TOKEN. Our summary lists: Node.js; A credential in SENTRY_AUTH_TOKEN.

Does Sentry Android SDK access the network?

SKILL.md names 2 domains. As links in the text: docs.sentry.io and github.com. This is read from the text; nothing was executed.

Is Sentry Android SDK safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sentry Android SDK use?

Sentry Android SDK is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sentry Android SDK use?

About 7.7k tokens (SKILL.md is roughly 31k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 30k tokens, read only when the agent opens those files.

What are the alternatives to Sentry Android SDK?

Skills that share tags, products or a category with Sentry Android SDK: Android Audio E2E (hyochan/react-native-nitro-sound, 961 stars), Apc Build (Joker-x-dev/AndroidProject-Compose, 102 stars), Dt Setup Android (Dynatrace/dynatrace-for-ai, 161 stars) and Android Dev (OpenMinis/MinisSkills, 440 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sentry Android SDK?

getsentry (a GitHub organization, an official publisher) maintains it in getsentry/sentry-for-ai, which has 268 GitHub stars. The repository holds 32 skills in this directory. The repository was last updated on October 7, 2026.

Source: getsentry/sentry-for-ai on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.