How do I correctly import using Maven in Android Studio?

Asked

Viewed 113 times

1

I imported the org.apache.commons:commons-email through the command ALT + SHIFT + CTRL + S in Android Studio. The class identified without problems but I can not compile the project! PS: I entered the error directory and only has a file activation-1.1.1.jar

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

Importação de dependência no Maven

  • 2

    If I’m not mistaken you’d have to include the packagingOptions { exclude 'META-INF/LICENSE.txt' } in his Gradle.build from its main module to delete the duplicate file.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.