For what purpose is packagingOptions used? [duplicate]

Solution for For what purpose is packagingOptions used? [duplicate]
is Given Below:

Something I noticed in build.gradle when I use android studio canary.

What exactly is its intended use?

packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}' // ??? 
        }
    }

I’m not sure how to link comments, but this is what commonsware on this question:

“If 2+ libraries contain those files, you’ll get a build conflict.
Since you don’t need those files in your APK, the typical solution is
to exclude them.”

For a more detailed answer, I found this question/answer very good.

P.S. – I tried marking this as duplicate but I don’t think I did it right. ^_^;;