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

后端 未结 3 1919
心在旅途
心在旅途 2020-11-30 15:24

I am creating one app that uses a RestAPI to fetch data, and for that operation I am using retrofit 2, okhttp3 and jackson for parsing json to object, my app also use Fireba

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 15:40

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

提交回复
热议问题