More than one file was found with OS independent path ‘META-INF/LICENSE’

You can add this in yourProject/app/build.gradle inside android{}. The exclude function adds the named resource to the list of resources that are not packaged in the APK.

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/*.kotlin_module") 
      }          
}

The exclude function is deprecated in 7.0.2 and you should use something similar to this:

android {
   ...
   packagingOptions {
       resources.excludes.add("META-INF/*")
   }
}

Leave a Comment