sentry-react-native / android
AGENTS.md1.8k starsChanged 3 months agoMITView on GitHub
Depth lives in the skills. code-guidelines (.agents/skills/, esp. references/native-bridge.md) is authoritative for bridge and native conventions — load it before non-trivial work. This file is the quick reference for the Android surface; where a convention here overlaps a skill, the skill wins. Android native code supports both React Native architectures — a bridge-method change usually has to land in both: Catch Throwable at the boundary — not just Exception, so an Error can't crash the app either (the module code…
Trending
Quiet this year.thin dataabout the whole repository
Who's talking about getsentry/sentry-react-native
- bluesky-social/social-app“Make Sentry optional”GitHub · Sep 8, 2023 · 21 reactions
- expo/sentry-expo“Critical Security - Upgrade @sentry/react-native to 1.3.9”GitHub · May 21, 2020 · 15 reactions
- expo/expo“[SDK 51] Xcode 16 compilation fails on pegged Sentry version”GitHub · Jul 2, 2024 · 14 reactions
- react/react-native“[0.60.3] --sourcemap-output | enableHermes: false | gradle file | wrong output path”GitHub · Jul 17, 2019 · 10 reactions
- expo/expo“[expo] Bump recommended @sentry/react-native version”GitHub · Sep 25, 2024 · 8 reactions
The biggest 5 of 9 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 9
Talked about on GitHub (9 times).
On GitHub · 9
- Sep 8, 2023Make Sentry optional — bluesky-social/social-app21 reactions
- May 21, 2020Critical Security - Upgrade @sentry/react-native to 1.3.9 — expo/sentry-expo15 reactions · 28 comments
- Jul 2, 2024[SDK 51] Xcode 16 compilation fails on pegged Sentry version — expo/expo14 reactions · 12 comments
- Jul 17, 2019[0.60.3] --sourcemap-output | enableHermes: false | gradle file | wrong output path — react/react-native10 reactions · 8 comments
- Sep 25, 2024[expo] Bump recommended @sentry/react-native version — expo/expo8 reactions · 1 comment
4 more on GitHub
- Jul 19, 2024Update sessions after running beforeSend — getsentry/sentry-cocoa7 reactions · 6 comments
- Jun 22, 2022Bundling React Native with Hermes manually — react/react-native7 reactions · 24 comments
- Nov 6, 2019Implement hermes source maps — getsentry/rust-sourcemap7 reactions · 2 comments
- May 30, 2023Upgrade `@sentry/react-native` to version `5` — expo/sentry-expo6 reactions · 6 comments
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- packages/core/AGENTS.mdAGENTS.md
- packages/core/ios/AGENTS.mdAGENTS.md
- samples/expo/AGENTS.mdAGENTS.md
- samples/react-native/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- code-guidelinesSkill
- design-firstSkill
- diagnosing-bugsSkill
- reviewSkill
- specSkill
- test-guidelinesSkill
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Use Google Java Format (enforced by CI)
- Distinctive: line 25
Use ktlint formatting (enforced by CI)
- Distinctive: line 26
Prefer Kotlin idioms (data classes, extension functions, etc.)
- Very specific: line 66
Add mavenLocal() to sample's android/build.gradle
- Distinctive: line 67
Update version to locally published version
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
packages/core/android — Java & Kotlin
Depth lives in the skills.
code-guidelines(.agents/skills/, esp.references/native-bridge.md) is authoritative for bridge and native conventions — load it before non-trivial work. This file is the quick reference for the Android surface; where a convention here overlaps a skill, the skill wins.
Formatting & Linting
| Task | Command |
| Java format (Google Java Format) | yarn fix:android |
| Kotlin format (ktlint) | yarn fix:kotlin |
| Java lint check | yarn lint:android |
| Kotlin lint check | yarn lint:kotlin |
| PMD static analysis | yarn java:pmd |
Code Conventions
Java
- Use Google Java Format (enforced by CI)
- Package structure:
io.sentry.react.* - Null safety: Use
@Nullableand@NonNullannotations
Kotlin
- Use ktlint formatting (enforced by CI)
- Prefer Kotlin idioms (data classes, extension functions, etc.)
Architecture Variants
Android native code supports both React Native architectures — a bridge-method change usually has to land in both:
src/oldarch/— Legacy bridge implementationsrc/newarch/— TurboModule / Fabric implementationsrc/main/— Shared code (io.sentry.react)
Native Bridge Pattern (Java)
Catch Throwable at the boundary — not just Exception, so an Error can't crash the app either (the module code catches Throwable throughout) — and reject with the shared "SentryReactNative" code, not a per-method one:
@ReactMethod
public void nativeOperation(String param, Promise promise) {
try {
boolean result = performOperation(param);
promise.resolve(result);
} catch (Throwable e) {
promise.reject("SentryReactNative", e.getMessage(), e);
}
}Boundaries
✅ Always
- Land a bridge-method change in both
src/oldarch/andsrc/newarch/— one arch is not done. - Catch
Throwableat every@ReactMethodandpromise.reject(...)— an uncaught throwable crashes the host app. - Gate any user data added to events/breadcrumbs/spans on
sendDefaultPii.
🚫 Never
- Change the codegen bridge ABI without mirroring it in JS + iOS and keeping it backward-compatible with an older cached native binary.
- Bump the bundled
io.sentry:sentry-androidversion by hand — go throughscripts/update-android.sh.
Working with Local sentry-java
- Build sentry-java:
cd sentry-java && make dryRelease - Add
mavenLocal()to sample'sandroid/build.gradle - Update version to locally published version
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

