【问题标题】:duplicate entry: android/support/v4/graphics/drawable/DrawableCompatHoneycomb.class重复条目:android/support/v4/graphics/drawable/DrawableCompatHoneycomb.class
【发布时间】:2016-11-29 01:17:02
【问题描述】:

将最小 sdk 更改为 16 后,我遇到了该错误

错误:任务 ':app:transformClassesWithJarMergingForDebug' 执行失败。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android/support/v4/graphics/drawable/DrawableCompatHoneycomb.class

这是我的 build.gradle (app)

 apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
defaultConfig {
    applicationId "com.nicoleiesperida.crazyjeepney"
    minSdkVersion 16
    targetSdkVersion 23
    multiDexEnabled true
    ndk {
        moduleName "player_shared"
    }
}
configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'
}
externalNativeBuild {
    ndkBuild {
        path 'src/main/jni/Application.mk'
    }
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
productFlavors {
}
}

dependencies {
compile 'com.google.android.gms:play-services:+'
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/support-v4-19.0.1.jar')
compile 'com.facebook.android:facebook-android-sdk:4.+'
}

【问题讨论】:

标签: android android-studio


【解决方案1】:

同一个类由两个不同的依赖项提供。运行

gradle app:dependencies

./gradlew app:dependencies

其中 app 是应用项目名称。然后找到 support v4 包并将其从依赖项中排除。应该是脸书吧。

【讨论】:

  • 我已经排除了 v4 包配置 { all*.exclude group: 'com.android.support', module: 'support-v4' }
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-01-16
  • 2015-09-05
相关资源
最近更新 更多