Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send Android Crash report using ACRA

Am trying to send crash report from my applicatio to my domain or Mail but failed still.

To get the crash report in mail, I did

@ReportsCrashes(

      formKey = "",
      mailTo = "[email protected]"
  )

And the response is, Sending file 1372758321000-approved.stacktrace

checkAndSendReports - finish

To get the crash report in my domain, I did

@ReportsCrashes(

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

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

Any help will be handy for me and appreciated.

like image 647
Joseph Avatar asked Jul 04 '13 06:07

Joseph


People also ask

How do I report a crashed Android app?

Select an app. On the left menu, select Quality > Android vitals > Crashes and ANRs. Near the center of your screen, use the filters to help you find and diagnose issues. Alternatively, select a cluster to get more details about a specific crash or ANR error.

What is Acra Android?

What is ACRA ? ACRA is a library enabling Android applications to automatically post their crash reports to a report server. It is targeted to android applications developers to help them get data from their applications when they crash or behave erroneously.


3 Answers

ACRA works for me sending reports by e-mail when I do exactly as they say in their docs:

@ReportsCrashes(mailTo = "[email protected]", // 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 are probably forgetting the toast part. Or can it be you don't have an e-mail program (such as when you're running on the simulator).

I think sending reports by Google docs are not supported anymore.

like image 76
Alexander Kulyakhtin Avatar answered Oct 23 '22 04:10

Alexander Kulyakhtin


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 = "[email protected]", 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);
        }
    }
like image 29
Hitesh Sahu Avatar answered Oct 23 '22 04:10

Hitesh Sahu


No,not like Alex say,the mode property has no releation to the reporting type,you can see it in the source code in github using the mailTo type,you should make sure that:

  1. your app has the permission to connect network;
  2. have an e-mail program in your device like Alex say;
  3. have you invoked the ACRA.init(this) method in your application's oncreate()?

if all of these have done,then run your app,it will note you to configure the email,such as username and password and so on.

like image 29
user2327225 Avatar answered Oct 23 '22 03:10

user2327225