Android builder packaging DuplicateFileException

The from running an Android app after added some libraries in the dependencies.

Error:Execution failed for task ‘:app:transformResourcesWithMergeJavaResForDebug’.
> Duplicate files copied in APK META-INF/NOTICE

The fix, add this in the app build gradle file inside the android tag

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'

Search within Codexpedia

Custom Search

Search the entire web

Custom Search