Search code examples
androidacra

Using ACRA with tracepot as backend


I have just finished my first android app as part of a school project ..one of my friends encountered a problem while trying to explore one of the activities in the app ..so i searched for solutions to get the crashes reports whenever they happen to fix the bugs ..i came across ACRA ..and I followed one of SO threads to setup ACRA to my app ..

RESULT: when the crashs happens the gmail app get launch in the device and the user (if he want to) he'll send the crash report by email ..Consedering not all users will want to ..i found in a comment in one of the SO threads that some developers use tracepot.
so i have used their link for integration in formUri but exploring my account on tracepot i get nothing ..is there something i am doing wrong (or if there is a better solution than using tracepot a backend , please suggest/explain or link a good tutorial, thanks!) MyApplication.Java ( AFTER EDITING

@ReportsCrashes(


 formUri = "https://collector.tracepot.com/79b1***",
         reportType = org.acra.sender.HttpSender.Type.JSON,
    httpMethod = org.acra.sender.HttpSender.Method.PUT,
                mode = ReportingInteractionMode.TOAST,
        resToastText = R.string.crash_toast_text
)
public class MyApplication extends Application {
     @Override
    public void onCreate() {
        super.onCreate();

  CaocConfig.Builder.create()
            //.errorActivity(CustomErrorActivity.class) //default: null (default error activity)
            .apply();

        // The following line triggers the initialization of ACRA
        ACRA.init(this);
    }
}

EDIT : msg in logcat if i use the http and email:

09-17 18:37:33.700 14329-14812/ma.ac.iav.menunaviagtion:acra W/ACRA: ma.ac.iav.menunaviagtion reports will be sent by email (if accepted by user).
09-17 18:37:33.703 14329-14812/ma.ac.iav.menunaviagtion:acra I/ACRA: Sending report /data/user/0/ma.ac.iav.menunaviagtion/app_ACRA-approved/2018-09-17T18:37:33.441+01:00-IS_SILENT.stacktrace

if i use only the http :

09-17 22:47:00.648 20116-20137/ma.ac.iav.myapplication:acra E/ACRA: Failed to send crash report for /data/user/0/ma.ac.iav.myapplication/app_ACRA-approved/2018-09-17T22:44:52.199+00:00-IS_SILENT.stacktrace

IMPLEMENTATION:

compile 'ch.acra:acra:4.9.2'

LOGCAT FOR F43nd1r

09-18 01:39:49.631 18508-18803/? E/AndroidRuntime: FATAL EXCEPTION: Thread-5
    Process: ma.ac.iav.myapplication, PID: 18508
    java.lang.InternalError: Thread starting during runtime shutdown
        at java.lang.Thread.nativeCreate(Native Method)
        at java.lang.Thread.start(Thread.java:733)
        at android.app.SharedPreferencesImpl.startLoadFromDisk(SharedPreferencesImpl.java:119)
        at android.app.SharedPreferencesImpl.<init>(SharedPreferencesImpl.java:112)
        at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:392)
        at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:373)
        at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
        at cat.ereza.customactivityoncrash.CustomActivityOnCrash.getLastCrashTimestamp(CustomActivityOnCrash.java:673)
        at cat.ereza.customactivityoncrash.CustomActivityOnCrash.hasCrashedInTheLastSeconds(CustomActivityOnCrash.java:683)
        at cat.ereza.customactivityoncrash.CustomActivityOnCrash.access$200(CustomActivityOnCrash.java:52)
        at cat.ereza.customactivityoncrash.CustomActivityOnCrash$1.uncaughtException(CustomActivityOnCrash.java:112)
        at org.acra.builder.ReportExecutor.endApplication(ReportExecutor.java:269)
        at org.acra.builder.ReportExecutor.dialogAndEnd(ReportExecutor.java:254)
        at org.acra.builder.ReportExecutor.access$400(ReportExecutor.java:42)
        at org.acra.builder.ReportExecutor$2.run(ReportExecutor.java:217)

Solution

  • By default, if the mail config is present, Acra 4 will send via mail and nothing else. To use both you'd have to configure the reportSenderFactories.


    400: Client error

    Indicates that tracepot rejected your report. This could have multiple reasons. To find out what the problem is, call ACRA.DEV_LOGGING = true; right before ACRA.init and post all logcat with the ACRA tag.


    Also note that ACRA 4.9.2 does not support android Oreo and above, it is recommended to upgrade to at least ACRA 4.11, or just the newest version 5.2.0.