0
votes

I imported the org.apache.commons:commons-email via the command ALT + SHIFT + CTRL + S Android Studio. The class identified without problems but I can't build the project PS: I went into the error directory and has only one activation- 1.1.1.jar file Import my dependencies

21:30:01 Gradle build finished with 2 error(s) in 34 sec

Error:duplicate files during packaging of APK /home/daniela/AndroidStudioProjects/ConectaSP/app/build/outputs/apk/app-debug-unaligned.apk Error:Execution failed for task ':app:packageDebug'.

Duplicate files copied in APK META-INF/LICENSE.txt File 1: /home/daniela/.gradle/caches/modules-2/files-2.1/javax.activation/activation/1.1.1/485de3a253e23f645037828c07f1d7f1af40763a/activation-1.1.1.jar File 2: /home/daniela/.gradle/caches/modules-2/files-2.1/javax.activation/activation/1.1.1/485de3a253e23f645037828c07f1d7f1af40763a/activation-1.1.1.jar

1

1 Answers

1
votes

I've had this issue with Apache imports. You need to add:

packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/license.txt'
}

to your build.grade. You might then get some other errors, follow this pattern and keep adding excludes until it will compile.