Search code examples
androidcrashlyticsgoogle-fabriccrashlytics-android

Use Ereza/CustomActivityOnCrash with Fabric crashlytics


I use CustomActivityOnCrash made by ereza and Google's Fabric.

I am going through one issue that is not classified by class, because I reported in MyCrashActivity.

For reference, the Exception.printStackTrace() in the crash area is received as an Intent.

public class MyCrashActivity {
    ...
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        findViewById(R.id.abcdefg);

        StringBuffer crashErrorMsg = new StringBuffer();
        crashErrorMsg.append("\n").append(CustomActivityOnCrash.getAllErrorDetailsFromIntent(this, getIntent()));
        Crashlytics.logException(new Throwable(crashErrorMsg.toString())); // error report.
        sendReportAppCrash(crashErrorMsg.toString());
        ...
    }
    ...
}

I know. my fault. but, I don't know what to do about whether to divide Crashlytics.logException() and MyCrashActivity.

When these two are combined, All error reports are reported as a problem with "MyCrashActivity".


Solution

  • Yeah, I guess that fabric had reported error before crash. so, It seems that there were two reports. I removed fabric code to fix the problem. public class MyCrashActivity { ... @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); findViewById(R.id.abcdefg); ... } ... }

    As a result, I believe that this library is just for outputting a view gracefully prepared to die.

    This question may seem somewhat stupid, but I hope it helps.