Android 11 not handled : PlatformException(not_available,` No email clients found!, null, null)

See original GitHub issue

Hello

I got this error only on Android 11 (API 30) virtual device on Android Studio : PlatformException(not_available, No email clients found!, null, null)` The GMAIL client is already set up on the virtual device.

I do not reproduce on other devices (virtual or not) which are Android 10 or less (API 29 or less)

My code :

try {
        final Email email = Email(
          body: "some content",
          subject: "some subject",
          recipients: [''],
          attachmentPaths: [somefile.path],
          isHTML: false,
        );

        await FlutterEmailSender.send(email);
        debugPrint('email sent correctly');
      }
      catch (e) {
        debugPrint('error sending email');
        print(e);
      }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
deacon78commented, Mar 31, 2021

I answer to myself : In order to make “flutter_email_sender” work with ANDROID 11 devices, here are the instructions to follow :

Step 1 In android\build.gradle file, upgrade your Android Gradle Plugin (AGP) to version 4.1 like this :

dependencies { classpath 'com.android.tools.build:gradle:4.1.1'//3.6.4'//3.6.4 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.4' }

Step 2 : In android/app/src/main/AndroidManifest.xml file, insert this section just below the tags <uses-permission> :

<queries> <intent> <action android:name="android.intent.action.SENDTO" /> <data android:scheme="mailto" /> </intent> </queries>

Step 3 : Run Flutter CLEAN

Step 4 : Run Flutter PUB GET

Step 5 : Build your APP 😃

1reaction
deacon78commented, Mar 31, 2021

Hello @dpedrinha

Everyone who sets API level to 30 in the build.gradle file and then build his app and then test flutter_email_sender on an ANDROID 11 device will experience this issue.

I wonder why @sidlatau has not yet corrected this issue…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flutter email sender - Stack Overflow
I had the same issue on iPhone, it was caused because I hadn't set up the default iOS default Mail App.
Read more >
Developers - Android 11 Unhandled Exception - Bountysource
Android 11 Unhandled Exception: PlatformException(not_available, no email Managers available, null, null)
Read more >
Gmail messages are missing - Android - Google Help
This page can help you find your emails if: Some emails are missing. Emails aren't coming to your inbox. Your inbox is empty...
Read more >
Authenticate with Firebase on Android using a Phone Number
The reCAPTCHA flow will only be triggered when SafetyNet is unavailable or your device does not pass suspicion checks. Nonetheless, you should ensure...
Read more >
Exception Marshaling in Xamarin.iOS - Microsoft Learn
This document describes how to work with native and managed exceptions ... NSInvalidArgumentException *** setObjectForKey: key cannot be nil.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found