Reputation: 805
I am using ACRA and I have created a CustomReportSender. In this class I implement send method where I do some customizing of the report and then connect to custom backend url and send the report.
public void send(Context cnt, CrashReportData report) throws ReportSenderException {
//code for customizing crash report
HttpSender sender = new HttpSender(Method.POST, Type.JSON, urlToSend, null);
sender.send(cnt,report);
}
Method for sending report is TOAST, which means user gets displayed toast message and then crash report is automatically sent (without user interaction). Everything is working fine, reports are sent to beckend where I can analyze them, until just recently, when I found out that this does not work for Android 5.X. However it still works for all other versions of android until 4.4.4.
I tested it, but no errors or problems in log. It looks like lollipop is killing whole process before ACRA manages to send crash reports. However I though that crash reports are then sent at the next app start, which also does not happen. Does anyone else has this issues? How can I overcome this?
One point that I also found out is, that if I set mode to dialog, and then user confirms sending, then it works. Any help would be really appreciated.
Last things I see in LogCat.
Upvotes: 0
Views: 1111
Reputation: 805
Looks like the problem was, that in send method of my own reportSender I created a new Thread() and somehow because of that, Android just cuts the app there and send is stopped. Solution in my case: Thread was around the code which was trying to send crash reports. After I removed Thread then it worked.
Upvotes: 0
Reputation: 20196
It is possibloe for the Android Framework to kill your app before it has had a chance to send the report.
But ACRA will send any unsent reports on next app startup.
Have a look at your ACRA logs on startup (after an unsent crash). You should see it attempting to send then.
Upvotes: 0