When an Android app crashes on launch, logcat has the reason. Look for the line FATAL EXCEPTION: main followed by your package name, then read the exception class, its message and the first stack frame in your own code. That frame is where to start. On Spawndroid, live Logcat streams next to the running app, and a crash shows as a one line notice over the device with a shortcut to that line.
Summary
- Search logcat for FATAL EXCEPTION or AndroidRuntime, then your package name.
- Read three things: the exception class, its message, and the first stack frame under your package.
- Caused by lines at the bottom are often the real cause; the top exception can be a wrapper.
- A native crash shows as a tombstone with signal 11 or signal 6 instead of a Java stack trace.
- On Spawndroid, the crash notice names the exception and Show in logcat jumps to it. No adb or Android Studio needed.
What a launch crash looks like in logcat
E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: Process: com.example.app, PID: 4127
E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.MainActivity}: java.lang.IllegalStateException: API_KEY missing
E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3782)
E AndroidRuntime: ...
E AndroidRuntime: Caused by: java.lang.IllegalStateException: API_KEY missing
E AndroidRuntime: at com.example.app.Config.require(Config.kt:18)
E AndroidRuntime: at com.example.app.MainActivity.onCreate(MainActivity.kt:42)The first exception, Unable to start activity, only says the launch failed. The Caused by line says why, and the first frame under com.example.app, Config.kt line 18, says where. Frames under android. and java. are the framework calling your code; skip them until you have read your own.
Common causes of a crash on launch
| What logcat says | Usual cause |
|---|---|
| ClassNotFoundException or NoSuchMethodError | R8 or ProGuard removed a class used by reflection, or a dependency version mismatch. Check keep rules. |
| Resources$NotFoundException | A resource that exists only in some densities, languages or API levels. |
| UnsatisfiedLinkError: dlopen failed | The APK has no native library for the device's ABI. On ARM64 that means arm64-v8a is missing. |
| IllegalStateException in onCreate | Missing config, a build flavor without a key, or a dependency injection graph that failed to build. |
| SecurityException: Permission Denial | A runtime permission used before the user granted it, or a missing manifest entry. |
| NullPointerException in Application.onCreate | Init code that assumes state from a previous run, such as a saved token. |
Read the crash in the browser
Upload the APK to Spawndroid and start a session. The app launches on Android 12 to 16, and Live Logcat streams beside the screen. When the app crashes, a one line notice appears over the device, for example The app crashed: IllegalStateException: API_KEY missing. The phone does not move or resize, so you can keep watching the screen.
Show in logcat scrolls Live Logcat to the fatal line, with the stack frames kept together under it. Restart app launches it again so you can watch the crash happen a second time. Details opens the raw exception and the frame from your app, with Clear data & restart for crashes that depend on saved state and Copy diagnostics to paste the whole thing into an issue.
If the app freezes instead of closing, Android reports an ANR after 5 seconds without a response to input, and the notice reads The app stopped responding. Look in logcat for ANR in followed by your package, then the main thread's stack in the trace that follows.
Filter logcat down to the crash
- Use the level toggles to hide everything below Error.
- Search for your package name, AndroidRuntime, FATAL or a tag your app logs with.
- Search by pid to follow one process after a restart; the pid changes each launch.
- Crash traces stay together, so the stack frames are not split by other lines.
Native crashes
A crash in C or C++ code does not print a Java stack trace. Look for Fatal signal 11 (SIGSEGV) or Fatal signal 6 (SIGABRT), then the tombstone lines with backtrace and the library name. The notice reads The app crashed in native code. Spawndroid runs on ARM64, so arm64-v8a libraries run natively and a crash in that code reproduces as it would on a phone.
Without Spawndroid
With a device or emulator connected over USB, the same information comes from adb. Clear the buffer, launch the app, then print only errors:
adb logcat -c
adb shell monkey -p com.example.app -c android.intent.category.LAUNCHER 1
adb logcat -d '*:E' | grep -A 40 'FATAL EXCEPTION'Catch it before merge
The Spawndroid GitHub Action can open each pull request's APK for 30 seconds and report a crash in a PR comment, with the exception, the line in your code and the first error from logcat. A launch crash then shows up in review instead of after release.