acra: Not working send e-mail with GMail on Android 13
Pixel 6, Android 13, Build number: T1B3.221003.003. ACRA version: 5.9.6
Gmail is installed and working good. Autosync is enabled for GMail. But not working send e-mail from crash notification.
ACRA configuration in Application.attachBaseContext():
CoreConfigurationBuilder builder = new CoreConfigurationBuilder()
.withBuildConfigClass(BuildConfig.class)
.withReportFormat(StringFormat.KEY_VALUE_LIST)
.withAdditionalSharedPreferences(Arrays.asList(APPLICATION_PREFS_NAME));
builder.withPluginConfigurations(
new NotificationConfigurationBuilder()
.withChannelName(getString(R.string.notification_channel_crash_report))
.withChannelImportance(NotificationManager.IMPORTANCE_HIGH)
.withResIcon(R.drawable.ic_exclamation_notify)
.withTitle(getString(R.string.acra_notification_title))
.withText(getString(R.string.acra_notification_text))
.withResSendButtonIcon(0)
.withResDiscardButtonIcon(0)
.withSendOnClick(true)
.withEnabled(true)
.build(),
new MailSenderConfigurationBuilder()
.withMailTo("henrich.gron@gmail.com")
.withSubject("PhoneProfilesPlus" + packageVersion + " - " + getString(R.string.acra_email_subject_text))
.withBody(body)
.withReportAsFile(true)
.withReportFileName("crash_report.txt")
.withEnabled(true)
.build()
);
Crash log generated after application start:
16:40:22.646 ACRA E Failed to send crash reports for /data/user/0/sk.henrichg.phoneprofilesplus/app_ACRA-approved/2022-10-07T17:01:51.976+02:00.stacktrace
org.acra.sender.ReportSenderException: Policy marked this task as incomplete. ACRA will try to send this report again.
at org.acra.sender.ReportDistributor.sendCrashReport(ReportDistributor.kt:109)
at org.acra.sender.ReportDistributor.distribute(ReportDistributor.kt:65)
at org.acra.sender.SendingConductor.sendReports(SendingConductor.kt:50)
at org.acra.scheduler.DefaultSenderScheduler.scheduleReportSending(DefaultSenderScheduler.kt:61)
at org.acra.scheduler.SchedulerStarter.scheduleReports(SchedulerStarter.kt:49)
at org.acra.startup.StartupProcessorExecutor.processReports$lambda-5$lambda-4(StartupProcessorExecutor.kt:60)
at org.acra.startup.StartupProcessorExecutor.$r8$lambda$o2NE53IEwtcT_aLpWXA2a4JC9OE(Unknown Source:0)
at org.acra.startup.StartupProcessorExecutor$$ExternalSyntheticLambda0.run(Unknown Source:6)
at java.lang.Thread.run(Thread.java:1012)
Caused by: org.acra.sender.ReportSenderException: No email client found
at org.acra.sender.EmailIntentSender.sendWithSelector(EmailIntentSender.kt:124)
at org.acra.sender.EmailIntentSender.send(EmailIntentSender.kt:66)
at org.acra.sender.ReportSender.send(ReportSender.kt:59)
at org.acra.sender.ReportDistributor.sendCrashReport(ReportDistributor.kt:101)
at org.acra.sender.ReportDistributor.distribute(ReportDistributor.kt:65)
at org.acra.sender.SendingConductor.sendReports(SendingConductor.kt:50)
at org.acra.scheduler.DefaultSenderScheduler.scheduleReportSending(DefaultSenderScheduler.kt:61)
at org.acra.scheduler.SchedulerStarter.scheduleReports(SchedulerStarter.kt:49)
at org.acra.startup.StartupProcessorExecutor.processReports$lambda-5$lambda-4(StartupProcessorExecutor.kt:60)
at org.acra.startup.StartupProcessorExecutor.$r8$lambda$o2NE53IEwtcT_aLpWXA2a4JC9OE(Unknown Source:0)
at org.acra.startup.StartupProcessorExecutor$$ExternalSyntheticLambda0.run(Unknown Source:6)
at java.lang.Thread.run(Thread.java:1012)
Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND_MULTIPLE flg=0x10000001 clip={null {U(content)}} (has extras) sel=act=android.intent.action.SENDTO dat=mailto: flg=0x10000000} }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2200)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1839)
at android.app.ContextImpl.startActivity(ContextImpl.java:1101)
at android.app.ContextImpl.startActivity(ContextImpl.java:1072)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:432)
at org.acra.sender.EmailIntentSender.sendWithSelector(EmailIntentSender.kt:122)
at org.acra.sender.EmailIntentSender.send(EmailIntentSender.kt:66)
at org.acra.sender.ReportSender.send(ReportSender.kt:59)
at org.acra.sender.ReportDistributor.sendCrashReport(ReportDistributor.kt:101)
at org.acra.sender.ReportDistributor.distribute(ReportDistributor.kt:65)
at org.acra.sender.SendingConductor.sendReports(SendingConductor.kt:50)
at org.acra.scheduler.DefaultSenderScheduler.scheduleReportSending(DefaultSenderScheduler.kt:61)
at org.acra.scheduler.SchedulerStarter.scheduleReports(SchedulerStarter.kt:49)
at org.acra.startup.StartupProcessorExecutor.processReports$lambda-5$lambda-4(StartupProcessorExecutor.kt:60)
at org.acra.startup.StartupProcessorExecutor.$r8$lambda$o2NE53IEwtcT_aLpWXA2a4JC9OE(Unknown Source:0)
at org.acra.startup.StartupProcessorExecutor$$ExternalSyntheticLambda0.run(Unknown Source:6)
at java.lang.Thread.run(Thread.java:1012)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 26 (11 by maintainers)
Commits related to this issue
- new ACRA version (with fix for https://github.com/ACRA/acra/issues/1118) — committed to mtotschnig/MyExpenses by mtotschnig a year ago
- Fall back to legacy sending in case selector fails. Introduce additional legacy resolver check including type. Closes #1118 — committed to sai1025037768/acra by F43nd1r 2 years ago
We are again having this trouble with Android 13 and Gmail, one thing i spotted is that if i only have gmail and there is no selector it does not work, but if i have another email client (ex. outlook) and i select in chooser Gmail it works normally. We are using latest 5.9.7 version and this started happening recently (previously it worked okay)
@yuriykulikov that warning is indeed part of the problem. The ClassCastException is not, it has to be ignored as I can’t prevent it from appearing in the logs. Has been there for a long time but doesn’t matter.
Investigation shows the problem is with gmail and Android 13 security behaviour changes. Basically gmail doesn’t match intents with a selector or without a mime type anymore.
I had to implement a double fallback to match it on my device. Unfortunately this also means #831 might still show up on android 13+ devices.