More Than One File Was Found with Os Independent Path 'Meta-Inf/License'

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

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

Android Issue::More than one file was found with OS independent path 'androidsupportmultidexversion.txt' error

I got the same issue you can use this link as an reference

(Getting Androidx library issue even though its not enabled in android project)

or

You can directly Try to change minimum Android version >= 21 in your build.gradle

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
applicationId "app.com.app"
minSdkVersion 21
}

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

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!

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

Other answers were close, I had to this to the app/build.gradle to get it excluded properly.

packagingOptions {
exclude 'META-INF/sdk_release.kotlin_module'
}

How to fix More than one file was found with OS independent path 'META-INF/DEPENDENCIES' error in Android

Use packagingOptions pickFirst or exclude; think it should be save to exclude it:

android {
packagingOptions {
// pickFirst "META-INF/DEPENDENCIES"
exclude "META-INF/DEPENDENCIES"
}
}

There also seems to be a version mismatch in between 1.25.0 and 1.26.0. Current version is :

implementation "com.google.apis:google-api-services-drive:v3-rev173-1.25.0"

and the others might need to have version 1.25.0, too.



Related Topics



Leave a reply



Submit