0

I want to send mail.I have added javax.activation.jar and javax.mail when i debug my application it show this error

Error:Execution failed for task ':app:packageDebug'.

Duplicate files copied in APK META-INF/LICENSE.txt File 1: E:\getImageContent\app\libs\javax.mail-1.4.4.jar File 2: E:\getImageContent\app\libs\javax.mail-1.4.4.jar

please help me

Siluni Upeksha
  • 419
  • 2
  • 6
  • 17

2 Answers2

0

follow below steps:

1> Copy all three jar and add into lib folder.

2> add in gradle following code inside dependencies:

    compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/mail.jar')

for more info see this link: how to add external jar file in android studio

Community
  • 1
  • 1
Vishal Thakkar
  • 2,117
  • 2
  • 16
  • 33
0

Add this in your app build.gradle

 packagingOptions {
    exclude 'META-INF/NOTICE.txt' // will not include NOTICE file
    exclude 'META-INF/LICENSE.txt' // will not include LICENSE file
}
Arjun saini
  • 4,223
  • 3
  • 23
  • 51