Misha Mashina
Misha Mashina

Reputation: 2113

Solution needed, email composer crashes the app

I have a problem with cordova-plugin-email-composer: sending email was working in the app for some time, but today I found out it's not working anymore - upon calling .open on EmailComposer the app closes. Calling .isAvailable() and .getClients() returns undefined.

None of the suggestions at Ionic email composer crash on android 11 work for me. Since I was using @ionic-native/email-composer I also went with @awesome-cordova-plugins/email-composer but it didn't fix the issue either.

Any suggestions for fixes or alternatives?

I'm sorry if someone thinks there's no need for this question since it's asked in that link above, but since it's with accepted answer, I figured I should ask a new one. Powers-that-be: feel free to delete this question if it's inappropriate or unnecessary in your opinion.

Upvotes: 1

Views: 433

Answers (1)

Misha Mashina
Misha Mashina

Reputation: 2113

After a month of going back-and-forth to fixing this problem with my app, I finally found a solution with the help and guidelines of a kind soul answering my question on the plugin's GitHub repo.

So:

  1. Installed a 6.1.1 gradle version and in Android Studio > Gradle Settings pointed the Gradle to installation folder.
  2. Added distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip to gradle-wrapper.properties.
  3. Added
    <queries>
          <intent>
                <action android:name="android.intent.action.SENDTO" />
                <data android:scheme="*" />
          </intent>
    </queries>

inside of AndroidManifest.xml

  1. Finally set targetSdkVersion = 30 in variables.gradle.

Upvotes: 1

Related Questions