acra icon indicating copy to clipboard operation
acra copied to clipboard

Report as email attachment is lost when displaying dialog on Android 15

Open fabmazz opened this issue 11 months ago • 1 comments

Required reading http://www.acra.ch/docs/How-to-debug

Describe the bug When sending the report as email attachment, if there is no default email client to open, the attachment is lost, and I get on the logcat a message: W: No email client supporting attachments found. Attachments will be ignored

However, when I set an email app as default, the report json is loaded.

Expected behavior I'd expect the attachment to remain in the email after the app is chosen to complete the Intent.

Version

  • Android: 15
  • Phone: Xiaomi 13
  • ACRA: tested on 5.11.3 and 5.12.0

My configuration Inside the app MultiDexApplication

    private static final List<ReportField> REPORT_FIELDS = List.of(REPORT_ID, APP_VERSION_CODE, APP_VERSION_NAME,
            PACKAGE_NAME, PHONE_MODEL, BRAND, PRODUCT, ANDROID_VERSION, BUILD_CONFIG, CUSTOM_DATA,
            IS_SILENT, STACK_TRACE, INITIAL_CONFIGURATION, CRASH_CONFIGURATION, DISPLAY, USER_COMMENT,
            USER_APP_START_DATE, USER_CRASH_DATE, LOGCAT, SHARED_PREFERENCES);

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);

        CoreConfigurationBuilder builder = new CoreConfigurationBuilder();
        // mail stuff
        MailSenderConfigurationBuilder mailConfig = new MailSenderConfigurationBuilder();
        mailConfig.withMailTo("***email***")
                .withReportFileName(BuildConfig.VERSION_NAME +"_report.json")
                .withBody(getString(R.string.acra_email_message))
                .setEnabled(true);
        //dialog stuff
        DialogConfigurationBuilder dialogBuild = new DialogConfigurationBuilder();
        dialogBuild.withText(getString(R.string.message_crash))
                .withResTheme(R.style.AppTheme).setEnabled(true);
        //Set options
        builder.withBuildConfigClass(BuildConfig.class)
                .withReportFormat(StringFormat.JSON)
                .withDeleteUnapprovedReportsOnApplicationStart(true);
        //Add plugins
        builder.withPluginConfigurations(
            mailConfig.build(), dialogBuild.build()
        );


        builder.setReportContent(REPORT_FIELDS);

        ACRA.DEV_LOGGING = true;
        ACRA.init(this, builder);
}

fabmazz avatar Mar 20 '25 19:03 fabmazz

Unfortunately, I was unable to reproduce this issue on an Android 15 emulator. Looks like this:

Image

Both email apps receive the report.

Unfortunately, there have been a multitude of issues with Xiaomi devices (e.g. #804), as they tend to mess with the android operating system

F43nd1r avatar Mar 22 '25 22:03 F43nd1r