The DSL to exclude files is:
android {
packagingOptions {
exclude 'META-INF/NOTICE.txt'
}
}
You can add as many exclude statement as you want. The value is the archive path. No wildcard or glob support yet.
Note:-
You can add many statement like below.
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}