Error: More than one file was found with OS independent path 'META-INF/DEPENDENCIES'

The simple solution instead of excluding it is to just do

android {
    packagingOptions {
        pickFirst  'META-INF/*'
    }
}

First, try to add this line: exclude 'META-INF/DEPENDENCIES', then Run 'app'

android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
    }
}

If error continue occur: 'META-INF/INDEX.LIST', keep adding exclude 'META-INF/INDEX.LIST':

android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/INDEX.LIST'
    }
}

Success for me!


try add packagingOptions

android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
    }
}