For some time, Android Studio doesn\'t show me stacktrace when developed application crashes. All I can see is following line:
06-09 16:12:36.875 26037-2603
Elaborating on Radim's answer, logcat doesn't show exceptions that are handled by the setDefaultUncaughtExceptionHandler for the main thread.
You probably use an analytics library that registers itself as the default UncaughtExceptionHandler
.
Note that, this doesn't only apply to uncaught exceptions, but also to exceptions that you log with android.util.Log
. Code like this should log an exception, but will only show the "Failed" message:
try {
something();
} catch (Exception e) {
Log.v(LOG_TAG, "Failed", e);
}
Logcat will show this, with no stack trace, regardless of whether you use Log.w
, Log.e
, etc.
V/MyApp: Failed
Radim called out play-services-analytics
as a common culprit, but Google's new analytics library is firebase-core
; it has the same problem. I fixed it by disabling analytics collection on debug builds.
I changed this line:
FirebaseAnalytics.getInstance(this);
to this:
FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(!BuildConfig.DEBUG);
Thus, when I run debug builds in development, Firebase analytics doesn't handle exceptions, and I can see them in logcat.