Currently, the most 'modern' approach (with build.gradle.kts file) would be like this:
build.gradle.kts
android { packaging { resources.excludes.add("META-INF/*") } }