Com.Android.Builder.Packaging.Duplicatefileexception: Duplicate Files Copied in APK Meta-Inf/Maven/Com.Fasterxml.Jackson.Core/Jackson-Databind/Pom.Xml

com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.fasterxml.jackson.core/jackson-databind/pom.xml

Instead of this

packagingOptions {

exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'

}

try this

 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'

}

and more thing

Remove this line

apply plugin: 'com.google.gms.google-services'

from Bottom and add to Top after this apply plugin: 'com.android.application'.

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

Update :

just remove

compile fileTree(dir: 'libs', include: '*.jar')

and apply dependencies.

Duplicate files copied in APK META-INF/maven/com.squareup/otto/pom.xml

Add to build.gradle:

android {
...
packagingOptions {
exclude 'META-INF/maven/com.squareup/otto/pom.xml'
}

Also, instead of exclude you could use pickFirst

Android Gradle Duplicate files copied in APK META-INF/license.txt

Write below lines in your app level gradle file

android {
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'
}
}

Getting error like duplicate Duplicate files copied in APK META-INF/LICENSE

Try with

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

}

Then Clean-Rebuild And Run

FYI

You are getting

DuplicateFileException: Duplicate files copied in APK

Make sure Same dependencies are calling or not .

Comment

 compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile "org.apache.httpcomponents:httpcore:4.2.4"
compile "org.apache.httpcomponents:httpmime:4.3"

DO

    compile group: 'org.apache.httpcomponents', name: 'httpclient-android', version: '4.3.5.1'
compile 'org.apache.httpcomponents:httpmime:4.3.5'


Related Topics



Leave a reply



Submit