acra: Default NotificationConfigurationBuilder and MailSenderConfigurationBuilder - do not opens e-mail application

ACRA version 5.8.2 (and 5.8.1) using Java (not Kotlin).

Configuration is in Application.attachBaseContext():

        CoreConfigurationBuilder builder = new CoreConfigurationBuilder(this)
                .withBuildConfigClass(BuildConfig.class)
                .withReportFormat(StringFormat.KEY_VALUE_LIST);
        //builder.getPluginConfigurationBuilder(ToastConfigurationBuilder.class)
        //        .setResText(R.string.acra_toast_text)
        //        .setEnabled(true);
        builder.getPluginConfigurationBuilder(NotificationConfigurationBuilder.class)
                .withResChannelName(R.string.notification_channel_crash_report)
                .withResChannelImportance(NotificationManager.IMPORTANCE_DEFAULT)
                .withResIcon(R.drawable.ic_exclamation_notify)
                .withResTitle(R.string.acra_notification_title)
                .withResText(R.string.acra_notification_text)
                .withResSendButtonIcon(0)
                .withResDiscardButtonIcon(0)
                .withSendOnClick(true)
                .withEnabled(true);
        builder.getPluginConfigurationBuilder(MailSenderConfigurationBuilder.class)
                .withMailTo("henrich.gron@gmail.com")
                .withResSubject(R.string.acra_email_subject_text)
                .withResBody(R.string.acra_email_body_text)
                .withReportAsFile(true)
                .withReportFileName("crash_report.txt")
                .withEnabled(true);

        ACRA.DEV_LOGGING = true;

        ACRA.init(this, builder);

  1. In notification are two buttons: OK and CANCEL, Click on it do nothing.

  2. Click on notification body (is enabled by .withSendOnClick(true)) do not opens E-mail application or Share bottom sheet, but generated is:

2021-06-04 16:55:17.779 17970-17970/sk.henrichg.phoneprofilesplus D/ACRA: Found ConfigurationBuilders : [org.acra.config.MailSenderConfigurationBuilder@2c2a7e2, org.acra.config.NotificationConfigurationBuilder@6d48773] 2021-06-04 16:55:17.780 17970-17970/sk.henrichg.phoneprofilesplus D/ACRA: Using default Report Fields 2021-06-04 16:55:17.801 17970-17970/sk.henrichg.phoneprofilesplus D/ACRA: ACRA processName=‘sk.henrichg.phoneprofilesplus:acra’ 2021-06-04 16:55:17.810 17970-17970/sk.henrichg.phoneprofilesplus D/ACRA: Not initialising ACRA to listen for uncaught Exceptions as this is the SendWorker process and we only send reports, we don’t capture them to avoid infinite loops 2021-06-04 16:55:17.821 17970-17970/sk.henrichg.phoneprofilesplus D/ACRA: Registered content provider for authority sk.henrichg.phoneprofilesplus.acra

ACRA 5.7.0 working good.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 29 (13 by maintainers)

Most upvoted comments

and the solution is to bail out of general app initialization if it’s the ACRA sender process

Yes.

Workiiing 😃 Both fatal and non-fatal exception.

I’m added: if(ACRA.isACRASenderServiceProcess()) return;

  1. in onCreate() immediatelly after super.onCreate();
  2. in attatchBaseContext() immediatelly after super.attatchBaseContext();
  3. Acra configuration at attachBaseContext() but after if(ACRA.isACRASenderServiceProcess()) return;

Thank you very much.