I've integrated Firebase Crashlytics into my app as per Googles instructions:
https://firebase.google.com/docs/crashlytics/get-started
My problem is when I try to do custom logging such as:
Crashlytics.log("testing");
Crashlytics.log(Log.ERROR, TAG, "testing");
Crashlytics.getInstance().crash();
In Firebase Console I get the crash stack callback (as expected) BUT only one (probably the first) log entry from the first Crashlytics.log call done (not the ones above however).
I've waited 48h to see if there's a delay but nothing appears.
It works fine when I "force" the crash in the emulator.
I also tried new RuntimeException() instead of Crashlytics.getInstance().crash()
I am calling the Crashlytics functions in a library which is included in my app(s).
Mike from Firebase here. Crashlytics prioritizes capturing crashes over writing custom keys or logs as crashes are more important to capture. Once a crash happens, we need to act as quickly as possible to get the exact state of the device and all the threads running. Things are still changing and happening after a crash, so to get the most accurate stack trace, if a key or log has not been written out, we will drop that and capture the crash instead.
Given that the log you're not seeing is happening just before the crash occurs, I would expect the log closest to the crash to be ignored. When using custom logs and keys, it's best to log them as early as you can, for example when an activity changes. As a side note, for non-test crashes, this is usually not an issue since you don't know in advance where the crash will occur in your app.
Related
In my app when some services of it are running it suddenly displays that message on some occasions, but most of the time they work properly, when I've tested them I haven't had any problem.
I'd like to know if its possible to associate the event that causes that message to appear, with giving some extra information or at the very least writing a log that at least shows which class and what line of code causes the error.
From there I could investigate with greater ease what makes that message to appear, as right now I've no clue.
I'd like to know if its possible to associate the event that causes that message to appear, with giving some extra information or at the very least writing a log that at least shows which class and what line of code causes the error.
Every time that dialog appears, a Java stack trace is written to LogCat automatically. You can use Android Studio or other development tools to examine LogCat.
Is there any way I can get rid of this message despite the app being stopped due to any exception?
My app(background service) is designed in such a way that it always restarts itself within 1 mins in case it gets killed. So even if it gets stopped, it would be restarted again, with no negative impact. Hence that message would unnecessarily annoy/worry the users.
As the app works fine on my device, but on other's device, its giving that message once or twice a day. I have no way to read the logs and check whats going on. I have placed the try/catch block everywhere. And the code is too complex to dig into again and check whats wrong. In short, I don't want to get rid of the "cause" off the message. But the "message" itself. Is it at all possible?
So How do I get rid of android OS showing that message even if it has "stopped"?
So even if it gets stopped, it would be restarted again, with no negative impact
There is no way to know whether or not there is a "negative impact" until the source of the problem is found.
I have no way to read the logs and check whats going on. I
Use crash logging frameworks like ACRA to collect stack traces from production apps.
And the code is too complex to dig into again and check whats wrong.
Use the crash logs from crash logging frameworks like ACRA to identify the source of the problem.
Is it at all possible?
Read the documentation for your chosen crash logging framework and see what the options are for user notification regarding such crashes. Some, like ACRA, will offer a "silent" mode where the crash is logged but without informing the users of that crash.
Theoretically, you could set up your own Thread.setDefaultUncaughtExceptionHandler
In flurry site, in Event logs session instead of events sometimes
"uncaught"
is showing .Can anyone tell what does it means?
Is it any error from app side? [all events are displayed in site but in some sessions it shows one or two events then uncaught]
If you are on the latest Flurry SDK version, which has the errors beta enabled, then the uncaught would appear under event logs, which is normal.
You need to set setCaptureUncaughtExceptions as false where you're configuring flurry :
FlurryAgent.setCaptureUncaughtExceptions(false);
From flurry doc:
Used to allow/disallow Flurry SDK to report uncaught exceptions. The
feature is enabled by default, and if you would like to disable this
behavior, this must be called before calling init.
Hope this helps you.
The same problem was when I used FlurryAgent.setLogEvents(false); (I thought that this call disables logging output to the android adb log). Instead this call turns off event logging in Flurry Web Interface.
So just remove FlurryAgent.setLogEvents(false) from your code.
It is indeed an error in your app. An exception is raised, and you are not catching it. To know what is going on, you need to log uncaught exceptions to Flurry as well. This video explains how to do so.
I am using HTC One X.
There are some system application that has too many logs.
Because of that, I am able to see my application log only for some seconds. After some time, my logs are being remove from buffer since too many new logs from other application.
Can i disable log by using the tag.
Firstly, you cannot stop other applications from logging! Probably some apps more than others log too extensively causing an overflow. What you could try to do is
Force stop some apps so that thier logging activity is reduced(less chance it might reduce).
Secondly, as Rasel suggets,
Use DDMS features like filtering logs using application name, package name, TAG's etc. and pause logging.
In this way you will get a snapshot of your logs. Hope this helps!
I am new to android and my application involves lot of internet access and many times when the data that needs to come from a web service is unavailable my application crashes.
I tried to avoid as many cases as possible, but i am not sure if my application is crash free.
I am using an application named "delight circle" and sometimes that application crashes and shows me this Toast:
"The application has crashed and a report is sent to the admin"
and takes me back to the previous activity or previous action, and from here i can use the application normally again.
I have 2 questions:
How to make the application work normally after it crashes once. In my application, if it crashes then it asks me for force close and when i click it, it takes me to the previous activity(or action) but nothing works there, if i try to do anything it asks for force close again, i eventually end up force closing the application from Settings --> Applications --> myApp --> foce close.
How to send a report about what actually caused the application to crash?? Right now i have a lot of logs in every activity so, now if it crashes i can find out the exact reason and solve. But when i release the application how can i do this?
Thank You
You have to use UnCaughtExceptionHandler for this.
Here is a example,
http://trivedihardik.wordpress.com/2011/08/20/how-to-avoid-force-close-error-in-android/
Once you override the Exception Handler, you will be provided with access to the Log and from where, either you can send the error log which you get the from the SatckTrace as an Email or use Apis to do it.
I can give an answer to your second question, that is "How to send a report about what actually caused the application to crash" Try Crittercism in your code. It will help you to find the exact cause of failing the application. Not only that, it has so many features, like Live Stats, Unresolved crashes, Crash alarms and more.