4

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'
}
1halfazn
  • 313
  • 1
  • 3
  • 10

3 Answers3

4

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

packagingOptions {
    exclude 'META-INF/INDEX.LIST'
}
Priyanka
  • 3,369
  • 1
  • 10
  • 33
4

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'
}
PSK
  • 583
  • 7
  • 15
3

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'
}
1halfazn
  • 313
  • 1
  • 3
  • 10