taljacobson / flutter_mailer

A wrapper on top of MFMailComposeViewController from iOS and Mail Intent on android
MIT License
46 stars 35 forks source link

Android 11 Unhandled Exception: PlatformException(not_available, no email Managers available, null, null) #38

Open robindijkhof opened 3 years ago

robindijkhof commented 3 years ago

Probably the same problem as described here: https://github.com/sidlatau/flutter_email_sender/issues/63

It happens on Android 11 where the target is set to. 30.

taljacobson commented 3 years ago

yes seems to be the same issue.

as a quick fix it might be best to manually add the needed code to your AndroidManifest.xml


<application .... />
// add queries tag for mailto intent out side of application tag
<queries>
  <intent>
    <action android:name="android.intent.action.SENDTO" />
    <data android:scheme="mailto" />
  </intent>
</queries>

believe their might be a way to add a AndroidManifest.xml to the plugin that will merge the needed code without manual input from developers.

med-amine-ghanmi commented 3 years ago

@taljacobson Thank you worked for me !

zeeshanahmad0201 commented 3 years ago

I only added this in AndroidManifest.xml and it worked for me.

<uses-permission android:name="android.permission.INTERNET" />

I have these in my android/build.gradle

    classpath 'com.android.tools.build:gradle:4.0.1'
    classpath 'com.google.gms:google-services:4.3.5'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"