Error adding certain libraries in Android Studio, APK META-INF / LICENSE

1

It turns out that I am passing an application that I made in java to android but when copying the libraries to the Android libs folder when running the app I get an error which is the following:

This only happens with some libraries and I understand that it says they are duplicated or something like that ..

I would like you to explain me why this error comes out exactly and how to solve it if it is possible.

these are the libraries that I add to the project:

By the way, this error comes to me even without adding code to the app.

    
asked by Alexis Rodriguez 17.05.2017 в 17:24
source

1 answer

0

You certainly have duplicate files, in your file app/build.gradle , add the option section packagingOptions , exclude the files:

android {

    packagingOptions {
       exclude 'META-INF/DEPENDENCIES.txt'
       exclude 'META-INF/DEPENDENCIES'
       exclude 'META-INF/dependencies.txt'
       exclude 'META-INF/LICENSE.txt'
       exclude 'META-INF/LICENSE'
       exclude 'META-INF/license.txt'
       exclude 'META-INF/NOTICE.txt'
       exclude 'META-INF/NOTICE'
       exclude 'META-INF/notice.txt'
       exclude 'META-INF/LGPL2.1'

    }
}
    
answered by 17.05.2017 в 18:00