More than one file was found with OS independent path 'META-INF/INDEX.LIST' (Android / Gradle) [duplicate]
Asked Answered
C

3

8

I am trying to build my app and get the following error:

More than one file was found with OS independent path 'META-INF/INDEX.LIST'

I am pretty sure it is a conflict between these two Gradle dependencies, but have no idea how to solve it.

dependencies {
    implementation 'com.google.android.gms:play-services-vision:19.0.0'
    implementation 'com.google.cloud:google-cloud-vision:1.99.1'
}
Contumely answered 28/2, 2020 at 8:20 Comment(0)
H
5

add this line into app level build.gradle file in android{}

packagingOptions {
    exclude 'META-INF/INDEX.LIST'
}
Hideous answered 28/2, 2020 at 8:22 Comment(1)
This code is deprecated and does not compile. Please update your answer.Valenevalenka
B
5

For the latest android modular architecture/multi module

Please add this option part of the top module where the application class is present else it won't work.

packagingOptions {
     exclude 'META-INF/INDEX.LIST'
}
Bandoleer answered 16/7, 2021 at 2:0 Comment(0)
C
4

Solved by adding this into android{}

packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/ASL2.0'
    exclude 'META-INF/INDEX.LIST'
}
Contumely answered 28/2, 2020 at 8:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.