How to send an Android Crash report using ACRA

I am trying to send a crash report from my application to my domain or Mail, but failed.

To get a crash report in the mail, I did

@ReportsCrashes (

formKey = "", mailTo = " abc@gmail.com " ) 

And the answer is, File Submission 1372758321000-approved.stacktrace

checkAndSendReports - completion

To get a crash report in my domain, I did

@ReportsCrashes (

  formKey = "", formUri = "http://www.abc.com/test1" ) 

And the answer is, Sending the file 1372856882000-approved.stacktrace Failed to send the crash report for 1372856882000-approved.stacktrace org.acra.sender.ReportSenderException: error while sending the FORM report via Http POST

Any help would be helpful and appreciated.

+4
source share
3 answers

ACRA works to send reports by email when I do exactly what they say in their docs:

 @ReportsCrashes(mailTo = " reports@yourdomain.com ", // my email here mode = ReportingInteractionMode.TOAST, resToastText = R.string.crash_toast_text) 

https://github.com/ACRA/acra/wiki/Report-Destinations#sending-reports-by-email

You probably forgot some of the toast. Or maybe you do not have an email program (for example, when you are working on a simulator).

I think reporting by Google documents is no longer supported.

+23
source

Your application class should look like this.

 import android.app.Application; import org.acra.ACRA; import org.acra.ReportField; import org.acra.ReportingInteractionMode; import org.acra.annotation.ReportsCrashes; @ReportsCrashes(mailTo = " user@domain.com ", customReportContent = { ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.LOGCAT}, mode = ReportingInteractionMode.TOAST, resToastText = R.string.crash_toast_text) public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); ACRA.init(this); } } 
+2
source

No, not like Alex says, the mode property does not have access to the reporting type, you can see it in the source code in github using the mailTo type, you must make sure that:

  • Your application has permission to connect to the network;
  • You have an email program on your device, for example, Alex:
  • Have you called the ACRA.init (this) method in your oncreate () application?

if all this is done and then run the application, it will notice that you are setting up an email address such as username and password, etc.

+1
source

Source: https://habr.com/ru/post/1489628/


All Articles