Android studio not catching exceptions, maybe it is firebase? - android

Debugging my app, android studio is not catching fatal exceptions and I just get "Your application has closed", and looking at Android monitor, I don't see anything regarding an exception, maybe I see something about Logging event(FE), so maybe by guess is that maybe firebase is catching exceptions which works great for deployed applications, but not for running in debugger.
Can someone tell me how I can keep both deployed exception catching with firebase, but also still allow exceptions to be caught when running in android studio debugger.

In logcat set it to "No filter" (on the left hand side drop down list) and filter by you app package name
This way you can see your logs after the process has stopped

Related

What is the meaning of the CastStatusCodes 2255?

I have an Android sender app and Android TV receiver app. When I start to connect the Android TV receiver app, it returns an error code 2255 in onSessionStartFailed().
I have referred the Google Cast documentation (https://developers.google.com/android/reference/com/google/android/gms/cast/CastStatusCodes) and cannot found the definition of 2255 in this page.
Also, I try to read the code from com.google.android.gms.cast.CastStatusCodes, it seems that error code 2255 is a special case.
if (var0 < 2300) {
return String.format(Locale.ROOT, "Cast remote display status code %d", var0);
}
Thanks in advance.
Not sure if this is your issue, but this can happen if you try to run the Cast Debug Logger on a non-google receiver hardware.
As it says:
Warning: Make sure to change setEnabled to false for a production receiver.
Properly disabling it in prod fixed the issue for me. But, man, it's so bad that error codes are not properly documented. There are several other that can also be thrown for various reasons that are undocumented.
What was actually happening for me is the CAF library was throwing an exception because it is trying to load the debug logger, but the debug logger is not supported on non-google hardware. This caused the VM to not launch properly and so it started throwing remote display errors.
If that is not your issue, you should try to log in to the back-end if your device if possible and download an error log. Sometimes that can highlight what is happening. I don't know if it's possible to crash the VM in other ways, but it might be and the error log might show why.

Android not logging app crash exceptions

In my limited experience on a handful of Android devices, if an app crashes with an unhandled exception then that exception's written to the log. However I've come across a Samsung i8160 that doesn't. Other i8160s with various ROMs do. In fact, from boot, it doesn't log anything. It originated on eBay so the history is unclear, but rather than assuming it's an odd ROM and flashing something else I figured it was worth persisting in case the problem arises again elsewhere.
In researching, the first thing to try was to 'dial' *#*#2846579#*#* but this isn't recognised- it just tries to really dial that. There's a shorter *#9900# that does pop up a menu, but that only lets me dump the log and other info to files in /data/log for export. Since logging isn't up from boot, that doesn't export much.
Initially, /dev/log doesn't exist. One suggestion to fix this was to try logcat-enable from a shell. This isn't found. Another suggestion was to manually load the logging module by running insmod /lib/modules/logger.ko from a rooted shell. This brings logging up, but when an app crashes, all logcat outputs is
I/dumpstate( 8074): begin
I/dumpstate( 8074): done
I've found the dumpstate files, which include the logcat output, but there also it just notes creation of the dumps, not the exception that caused it.
As well as starting the module, I'm assuming somewhere there's some configuration determining what actions to take when an app crashes, and here it's not set to dump the exception and stack trace to the log because whoever did it figured logging wouldn't be running anyway. But I can't find anything like this. Does anyone have any ideas on how to progress further?
Some apps have a "report" function inbuilt in case their app crashes. When you choose report on the ANR message, usually a log is created for sending it to the developer. Maybe you can get an app to crash and catch that log (or maybe make your own one)

Unfortunately app has stopped message on restarting phone

My application is basically a File Manager with junk cleaner. It is working fine everywhere but when i restart my phone Unfortunately app has stopped message appears several times. Also sometimes it appears when any other application is started. Can anyone tell why it is happening, or how to detect the cause behind it.
To detect the cause behind, you can monitor the logcat.
Since the crash occurs after the phone restart and so if you are not able to see the exception in log cat, you can log the same into a file to see the cause of exception.
Use the below link for how to log unhandled exception into file.
https://derivedcode.wordpress.com/2015/06/29/how-to-log-un-handled-exceptions-in-android/

LogCat is not showing null pointer exception

My LogCat is often not showing null pointer exceptions..
Sample:
ProgressDialog pd;
ps.show();
Application stops (do not reacts for any action), but there is no information about any reason in logcat.
Another sample is with database - if there is no DB and I'm making actions on it, the same happens.
I tried (that action with DB) on my colleague's phone and there was normal error. I have all needed programmer options in my phone turned on.
Maybe someone know , why it is so? It was not burdensome, when I had small app, but now when it's bigger, it can be really frustrating.
I get this with android studio too...
Close android studio, restart ADB, and generally it starts working for me.
If that does not work then put a breakpoint at the line .show(); ... Then open up the logcat and then skip over the breakpoint. It then shows, I have similar issues.
(Windows 7 64 bit - Android Studio 0.82)
I dont like the IDE logcat option honestly.
The SDK comes with an adb binary, use the logcat option from there via
adb logcat or my personal favorite built in alias, adb lolcat
This will give you the log information for EVERYTHING happening on the device, and can be useful tracking down issues caused by device state.
For example, you can see network changes in the logcat, and if your app crashes on network call you wouldnt have any idea why if you just used the logcat output from your app.
In my case I was using: Thread.setDefaultUncaughtExceptionHandler in my application file. If that is not turned off during debugging you won't see any exception output. ( Just make sure to turn it back on again when you release so you can still handle your issues ).

Uncaught Error #2063 exception in Android flex application

My clients using my application on ANDROID and a lot of them are reporting uncaught exception error while using my Flex 4.6 application with latest Flash Player 11.1 swc.
My Flex application uses standard SPARK and MX components. The uncaught exception occurs immediately after application is launched, however none of my functions (connecting to RTMP, RTMFP & socket servers) seem to cause it, the error occurs after all the functions that I call upon program start have successfully executed.
Looks like error code #2063 means "Error attempting to execute IME command.".
My code doesn't call or access any IME functions at all.
It seems that this developer is experiencing same issue and is unable to locate the solution or workaround:
Flex/Flash runtime error #2063 on android
Also, none of the clients using Windows/Mac/Linux are experiencing this issue, only Android clients.
And they all are accessing same application/same code/exact same file.
It also seems like clients are not doing anything specific that triggers this error - they just start my flash site on their android browser and do not do any interaction with it, and getting this error just after launch.
What do I do / what is the best work around for this issue?
And I obviously don't have a stack trace, because my users are using it DO NOT use Adobe Flash Player debugger, however this person and posts seem to be exactly same issue and they have stack trace: http://forums.adobe.com/message/3410527
I have also submitted this issue to Adobe BugBase: https://bugbase.adobe.com/index.cfm?event=bug&id=3101786.
Thanks
can you add to your code the UncaughtErrorEvent.UNCAUGHT_ERROR listener on the main movie loaderInfo object? If you can then it should intercept this error and you can collect some information about it or just ignore it if it doesn't break your application.
best regards

Categories

Resources