How to resolve 'More than one file was found with OS independent path META-INF/DEPENDENCIES'
1. The purpose of this post
I will demonstrate how to resolve this error when using Android Studio:
2. Environments
- Android Studio 3.x
- Gradle wrapper version:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
- Project
build.gradle
:classpath 'com.android.tools.build:gradle:3.5.0'
3. Solution and Code
Add the following packaging options in the app’s build.gradle
:
Clean, rebuild, and run the app. Everything should work as expected.
4. Summary
In this post, we explored how to resolve the More than one file was found with OS independent path 'META-INF/DEPENDENCIES'
error in Android Studio. By adding specific exclusions in the packagingOptions
block of the build.gradle
file, we can avoid conflicts caused by duplicate files. This solution is particularly useful when working with multiple dependencies that may include overlapping resources. Remember to clean and rebuild your project after making changes to ensure the modifications are applied correctly.
Final Words + More Resources
My intention with this article was to help others who might be considering solving such a problem. So I hope that’s been the case here. If you still have any questions, don’t hesitate to ask me by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!