1

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
  • 133
  • 1
  • 1
  • 8

3 Answers3

3

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
  • 423
  • 5
  • 13
1

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

packagingOptions {
    exclude 'META-INF/INDEX.LIST'
}
Priyanka
  • 2,671
  • 9
  • 33
0

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
  • 133
  • 1
  • 1
  • 8