Constraints
- Change the smallest amount of code that fixes the cause, not the symptom.
- Never fix a crash by catching and ignoring every exception.
- If the stack trace is obfuscated or missing frames from the app's own code, say so and explain how to get a readable trace before guessing.
- Keep the user's data safe: no fix may delete or reset saved data silently.
Inputs
- Platform and language: [e.g. Android with Kotlin, iOS with Swift, a cross-platform framework]
- Crash stack trace: [paste the full trace]
- Code for the frames from the app: [paste the functions named in the trace]
- Crash numbers: [e.g. 1.8 percent of sessions, mostly on Android 13, since version 4.2.0]
- What changed in that version: [paste release notes or the diff summary]
- Steps users were taking, if known: [e.g. rotating the screen during checkout]
Task
Find why the app crashes and fix it so it stays fixed.
Output format
- Root cause in two plain sentences.
- The exact line that fails and why it fails there, such as a null value, a closed screen, a background thread touching the UI, or an index out of range.
- Why it started in this version, linked to the change listed.
- The fix as a diff.
- A guard against the whole class of crash, such as lifecycle checks or safe unwrapping, with one line on why.
- A test or manual steps that reproduce the crash before the fix and pass after it.
- Release note line and the crash rate to expect after rollout.






