react-native-smtp-mailer icon indicating copy to clipboard operation
react-native-smtp-mailer copied to clipboard

Support for android 11(30)

Open AlenToma opened this issue 4 years ago • 16 comments
trafficstars

The app crash when I build it for API 30 and running it on android 11.

The jar files are not supported anymore.

I have fixed my fork but wanted to tell anyone who is having the same issue, or maybe you would like to have a look at the changes I did.

On android build.grade I removed implementation fileTree(dir: 'libs', include: '*.jar') and added

    implementation 'com.sun.mail:android-mail:1.6.6'
    implementation 'com.sun.mail:android-activation:1.6.6'

I also added the following options under android.

   packagingOptions {
		exclude 'META-INF/mimetypes.default'
		exclude 'META-INF/mailcap.default'
	}

All the credit goes for the following site https://issuetracker.google.com/issues/172544275?pli=1 I found the solution there.

AlenToma avatar Oct 20 '21 01:10 AlenToma

Will this fix this error?

Rejecting class com.sun.mail.handlers.text_plain that attempts to sub-type erroneous class com.sun.mail.handlers.handler_base

mrkprdo avatar Oct 20 '21 16:10 mrkprdo

Yes, its exactly the error that it fixes

AlenToma avatar Oct 20 '21 17:10 AlenToma

Yes, its exactly the error that it fixes

I tried your solution but still did not work on my end. Any thoughts whats causing this error?

mrkprdo avatar Oct 20 '21 22:10 mrkprdo

It did work for me, try and install my fork and test it npm install https://github.com/AlenToma/react-native-smtp-mailer.git As for why, you can read about this here https://issuetracker.google.com/issues/172544275?pli=1

AlenToma avatar Oct 21 '21 00:10 AlenToma

Ok, got it to work. As i later understand that changes should be applied to the library build.gradle, not the main app build.gradle. Thanks!

mrkprdo avatar Oct 26 '21 23:10 mrkprdo

@AlenToma hi , it used to work fine on android <android 11 but since i applied the changes i keep getting back an error of Authentication failed, i did check my id and pw over 20 time no clue what could be the problem

DDAmine avatar Nov 03 '21 16:11 DDAmine

There is a setiings you have configurate on Gmail. if you are using it on with Gmail. Other wise i have no idea why.

AlenToma avatar Nov 03 '21 16:11 AlenToma

@AlenToma my bad all good , u are a lifesaver , just to clarify you add the code below in the project-name/android/app/build.gradle

   packagingOptions {
		exclude 'META-INF/mimetypes.default'
		exclude 'META-INF/mailcap.default'
	}

and you add this code in node_modules/react-native-smtp-mailer/android/build.grade

    implementation 'com.sun.mail:android-mail:1.6.6'
    implementation 'com.sun.mail:android-activation:1.6.6'

DDAmine avatar Nov 03 '21 16:11 DDAmine

It did work for me, try and install my fork and test it npm install https://github.com/AlenToma/react-native-smtp-mailer.git As for why, you can read about this here https://issuetracker.google.com/issues/172544275?pli=1

It's Worked! thank you .

supawitbeat avatar Jun 17 '22 10:06 supawitbeat

I am getting Error:IO Exception while sending message without attaching any file or document. Ive use npm install https://github.com/AlenToma/react-native-smtp-mailer.git this fork.

IsharaJaylath avatar Sep 01 '22 05:09 IsharaJaylath

Hi, When I build, I [have this error: Task :app:mergeDebugJavaResource FAILED

image_2023-01-26_110148794

How solve this plese ?

kd-fs avatar Jan 26 '23 10:01 kd-fs

I solve this by replace.

packagingOptions { exclude 'META-INF/mimetypes.default' exclude 'META-INF/mailcap.default' }

with

packagingOptions { resources.excludes.add("META-INF/*") }

kd-fs avatar Jan 26 '23 12:01 kd-fs

I am getting Error:IO Exception while sending message without attaching any file or document. Ive use npm install https://github.com/AlenToma/react-native-smtp-mailer.git this fork.

I have same error.

kd-fs avatar Jan 26 '23 12:01 kd-fs

when I attach the file it doesn't work either.

kd-fs avatar Jan 26 '23 15:01 kd-fs

I am using this in a managed expo project. Should I prebuild the project and then make the changes in these files? Or should I write a config plugin for it? I know I probably should ask this in an expo thread, but I think I'm not the only one with that setup while using this tool.

markusgabriel avatar May 10 '23 08:05 markusgabriel

Exception

I am also getting the same error, any one have a solution? [Error: IOException while sending message]

dhavalsigma avatar Jul 04 '24 15:07 dhavalsigma