duplicate entry android support v4 in serviceinfoversion impl.class

纵饮孤独 提交于 2021-02-08 08:16:24

问题


i have this error :

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl.class

on this build.gradle app :

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.mtma.mytripmyadventure"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile('com.android.support:support-v4:23.4.0') {
        force = true;
    }
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:cardview-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.roughike:bottom-bar:1.2.1'
    compile 'com.google.android.gms:play-services-maps:9.8.0'
    compile 'com.android.support:support-v4:23.4.0'
}

i have try many things to do but the result still the same

i have add all*.exclude group: 'com.android.support', module: 'support-v4'

but still error

help me to resolve this.. icant resolve it in 1 day thx stackoverflow


回答1:


That error in your latest comment is completely different as it relates to an XML issue in your Activity.

You do not need the support-v4 dependency explicitly. It is included with the v7 dependency. That being said, definitely do not need to force = true on it

The solution to the first error is remove both dependencies of compile 'com.android.support:support-v4




回答2:


I had a similar issue, I was importing

compile fr.avianey.com.viewpagerindicator:library:2.4.1.1'

and had to add "@aar" termination

compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1@aar'




回答3:


This has worked for me.

compile('com.jakewharton:butterknife:8.5.1') {
        exclude module: 'support-compat'
}


来源:https://stackoverflow.com/questions/40320795/duplicate-entry-android-support-v4-in-serviceinfoversion-impl-class

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