How to send Android Crash report using ACRA

后端 未结 3 1735
灰色年华
灰色年华 2021-02-02 03:54

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(

            


        
3条回答
  •  醉话见心
    2021-02-02 04:38

    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);
            }
        }
    

提交回复
热议问题