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
Android Writing Logs to Text File
How to Pass Data from 2Nd Activity to 1St Activity When Pressed Back? - Android
Android Studio's Project Gradle File Changed
How to Implement Android Pull-To-Refresh
How to Get the Resource Id of an Image If I Know Its Name
Clear the Entire History Stack and Start a New Activity on Android
How to Crop Circular Area from Bitmap in Android
How to Get the Actionbar Height
List of Android Permissions Normal Permissions and Dangerous Permissions in API 23
How to Get Resource Name from Resource Id
How to Disable Gradle 'Offline Mode' in Android Studio
Telephonymanager.Getline1Number() Failing
Android: Progressdialog.Show() Crashes with Getapplicationcontext
Disable Scrollview Programmatically
How to Parse the Androidmanifest.Xml File Inside an .Apk Package
Taking Picture from Camera Without Preview
Programmatically Go Back to the Previous Fragment in the Backstack