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

ε祈祈猫儿з 提交于 2019-11-27 05:34:41

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.

Make changes in the gredle, You have to exclude to maven too.

packagingOptions {

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

}

and if you are using google-play-service you can exclude the annotation like

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile ('com.google.android.gms:play-services:8.1.0'){
    exclude group: 'com.google.guava'
}
}

Or you can try this also

configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}

implementation 'com.google.firebase:firebase-ads:15.0.1' implementation 'com.google.firebase:firebase-core:16.0.1'

add this implementation 'com.google.android.gms:play-services:12.0.1'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!