r/androiddev • u/royalraju907 • 1d ago
Video Spent way too long on an Android crash with nothing in Metro. logcat had the answer the whole time
Posting this because I lost a stupid amount of time on it and I doubt I'm the only one.
App just closes on Android. No red screen, nothing in Metro, DevTools disconnects. I did what everyone does: rerun, clear cache, paste the code into AI a few times.
The reason was in logcat the whole time. Native code threw, the app died before JS could say anything, and the Android log had the exact line.
What worked for me:
- open the android folder in Android Studio and open Logcat (it picks up the app even if you started it with yarn run android)
- clear it, then reproduce the crash
- set the level to Error and search FATAL EXCEPTION
- read the exception message first, then the first line in the stack trace that isn't Handler / Looper / ActivityThread. Click it and it jumps to the code
One thing that got me: in the terminal, filtering by pid after a crash gives you nothing because the process is gone. adb logcat -d -s AndroidRuntime worked better.
Also the stack trace only told me where it died, not who passed the bad value. I needed a breakpoint for that part.
I made a small demo crash and recorded the whole thing for anyone who'd rather watch than read: https://youtu.be/oVYBmnOVaI8
What do you check first when Metro says nothing?