ACRA toast appearing, but cannot explain why - acra

I have a complex Android app that uses ACRA for error reporting, which generally works fine.
Except, on one test device, I now see the ACRA toast appearing, during app startup, and then disappearing. But the app keeps running, and I get no report. It's as if an error happened, but nothing but a toast appeared. I find no clues in logcat.
But if I force a report by throwing an exception, I get the same toast, and I get the report posted to my server, and the app quits, all of which is desired behavior.
I've tried to track this down by adding a custom ReportingAdministrator just for the purpose of getting a stack trace. This works for my forced exception, but does get called for the mystery toast - the toast is displayed, but my administrator class method does not get called.
Any suggestions on how to find the cause of this errant toast event?
Note: ACRA is normally called by MyExceptionInterceptor. On an uncaught exception, it grabs some text and puts it uses the ACRA error report to add it to the report. It then calls ACRA.getErrorReporter().handleException(t, true);
Whatever is causing the ACRA toast to appear is not going through this path. I have not been able to find anywhere to set a breakpoint to catch it.
Setup code:
int acraLimitPerTime = VersionHelper.isDevelVersion() ? 1000 : 2;
CoreConfigurationBuilder builder = new CoreConfigurationBuilder(this)
.setBuildConfigClass(BuildConfig.class)
.setReportFormat(StringFormat.KEY_VALUE_LIST)
.setStopServicesOnCrash(true)
.setReportSendFailureToast("Error report could not be sent")
.setReportSendSuccessToast("Error report was sent")
.setEnabled(true)
.setExcludeMatchingSharedPreferencesKeys("^lat$", "^lng$");
builder.getPluginConfigurationBuilder(HttpSenderConfigurationBuilder.class)
.setUri(ISOL.URL_ACRA_REPORT)
.setHttpMethod(HttpSender.Method.POST)
.setBasicAuthLogin("*****")
.setBasicAuthPassword("*****")
.setEnabled(true);
builder.getPluginConfigurationBuilder(ToastConfigurationBuilder.class)
.setLength(Toast.LENGTH_LONG) //===jrm
.setText("An error has occurred and a report is being sent to the developer.")
.setEnabled(true);
builder.getPluginConfigurationBuilder(LimiterConfigurationBuilder.class)
.setPeriodUnit(TimeUnit.HOURS)
.setPeriod(1)
.setOverallLimit(acraLimitPerTime)
.setEnabled(true);
// The following line triggers the initialization of ACRA
ACRA.init(this, builder);
ACRA.getErrorReporter().putCustomData("BUILDDTG", MyBuildConstants.buildDTG);
new MyExceptionInterceptor().setUpFatalExceptionHandling();

I have been observing this very same behavior on my application. From the code base, I could track down that Toast message is triggered due to an unapproved report during startup.
I am not sure how it got to this state, but I guess that application has been shutted down before report was sent. It happens that this report is never treated, so I consistently get Toast notification on app startup.
Anyway, I could avoid startup notification by two means: set checkReportsOnApplicationStart to false on ACRA.init call, or clean acra unapproved folder inside your app data.
You may refer to this pull request (https://github.com/ACRA/acra/pull/1078) to better locate methods that cause this behavior.

Related

Find out sigabrt message

After xcode update my api methods stop work. I can't even see error message. I got this:
What i want is, to see something like usually typed in console:
Programm terminated due to uncaught exception.. etc. But i can't understand what error is and how to fix it. How to print out error message?
After i click on "next" breakpoint button, programm just exit and still there is no error.
Usually with SIGABRTs I go to the top of the error message in console to actually find out the error.

Issues with WebIDE CRUD template and OData errors

Has anyone successfully based an application off the WebIDE Fiori CRUD template? It doesn't seem to be able to handle errors in the batch OData request properly.
For example when you select an item in the master list and click EDIT to update it and I enter a value that I know will cause an error in the backend. The batch OData request is sent and the response is successful (overall) even though internally the update failed. You see a bad request 400 error in the console but the app doesn't react to it.
Using the ErrorHandler.js object you can easily code a message box to show a nice error message, however the app seems to get confused and always navigates to the top item in the list but the ODataModel still has pending changes so if you try to navigate it shows the data loss dialog.
Trying to debug it is very painful given the nature of the code with Promises inside promises inside promises and callbacks firing everywhere!!
Maybe there is a better example CRUD application to base your apps on?
Well.... Some more debugging and I've found that all of the weird issues occurring with the Fiori CRUD template are due to the model defaulting to auto refreshing after changes.
Which typically is a nice feature as the user does not have to hit the refresh button to see changes that have been made after adding a new entry or editing an object.
But this auto refresh on the model seems to play havoc with updates in batch mode.
Firstly, if the batch update is completely successful the app navigates to the first item in the master list - which is should not.
Secondly, when there is an error in the batch of sorts of weird shit happens.
So to fix this I just call oModel.setRefreshAfterChange(false) before the oModel.submitChanges() call (only when updating, not creating). The in the callback after the save is completed we reset auto refresh to true.
The crud app now works as expected and can correctly handle errors in the odata batch update without strange ui updates.
Jason,
but the error message they are providing is very simple, and does not support parsing error body like :
<code>005056A509B11ED199D882461C8C40FE</code><message xml:lang="en">The Data Services Request version '3.0' is not supported for the request payload.</message><
we have to do the code for parsing the errors then show in the message box

How to show error page when exception happens in JSF beforephase?

The JSF2 specs are pretty clear in that exceptions thrown in a beforephase method are swallowed by the container. All I see is a small message in the console log.
However, I threw an exception in the beforephase because data could not be retrieved, and of course I want to show an error page with some more information. Unfortunately I'm unable to work it out.
Throwing the Exception from anywhere else works fine, my error page and errorhandler are setup fine to catch these errors, but I can't pick them up from any beforephase method (fortunately I only have a few).
Any hints how this can be done?
Thanks!

Prevent error messages logged by system framework

The following message keeps getting logged to the console:
-[__NSCFSet minusSet:]: This app appears to be calling this method with
a non-set parameter. Please wait while the system corrects this...
I don't know what I did to this appear. I never call this function and don't know what things call this.
For me, this appear when a touch anything in my UIWebView. This can be a touch in text box, or just a simple touch in any area of the page. Any new touch will produce it.
Anyone have an idea how to solve it?
You should be able to find out whether your code is causing the log message or not. You can do this by interrupting the app when the message is logged and looking at the stack backtrace of the logging thread. Then, investigate what code created the object that is prompting the log message using malloc history or Instruments.
To start with, you can try adding a symbolic breakpoint on -[__NSCFSet minusSet:]. You could narrow it down to the actual code doing the logging if you looked at the disassembly for a call to NSLog and placed the breakpoint there.
Once you've ruled out your code, it's not your fault: it's time to file a bug report and move on. If the log messages are swamping more interesting log messages, you might try patching the binary so it doesn't log, but just living with it is likely to be easier (though much less fun).

Weird Error from Xcode Debugger

I am using SQL lite database in my iPhone app. I have a refresh button on my Home screen and upon click of then refresh button I parse data from my web service and store the results into a SQL lite database. When I click on refresh button repeatedly I get an error. The error occurs after a variable number of clicks/refreshes each time. The error is:
Failed to load debugging library at:
/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib
Custom data formatters are disabled.
Error message was: 0xe00805 "dlopen(/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib, 10): image not found"`
After this error, my app crashes and when I logged the error it gives me an error "Unable to open database"
Please help me to resolve this error.
Thanks
Sandy
It would appear that the debugger is having a problem loading the data formatters that create the displays for various datatypes in the debugger window's variable display panel. If you've added any customer formatters, you should remove them.
Try running the program without the debugger and see if you get a crash. If so, the problem is in the app. If not, it's most likely in Xcode itself. I would test a dummy project and see if you get the same error.
It's possible there is hellish recursion somewhere in your code. I have seen that bring the debugger down but not with this error message.