【问题标题】:com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/annotation/CallSuper.class?com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android/support/annotation/CallSuper.class?
【发布时间】:2016-01-19 21:02:29
【问题描述】:

我尝试了 stackoverflow 中所有可用的解决方案。但它们都不起作用。 这是我在 build.gradle 文件中的依赖项:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile ('com.android.support:appcompat-v7:23.1.1')
compile ('com.android.support:design:23.1.1')
compile ('com.google.android.gms:play-services:8.4.0')
compile files('libs/applovin-6.1.4.jar')
compile files('libs/appodeal-1.13.10.jar')
compile files('libs/chartboost-6.0.2.jar')
compile files('libs/inmobi-5.0.1.jar')
compile files('libs/my-target-4.1.2.jar')
compile files('libs/unity-ads-1.4.7.jar')
compile files('libs/yandex-metrica-android-2.00.jar')
compile ('com.android.support:multidex:1.0.1')

}

当我尝试运行时出现此错误: 错误:任务 ':app:transformClassesWithJarMergingForDebug' 执行失败。

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android/support/annotation/CallSuper.class

我已启用 multidex 并包含在清单中。我使用 ctrl+N 检查,CallSuper 在两个 jar 文件中找到:1) android.support.annotations2) support-v4。 请帮助我消除此错误。谢谢。

【问题讨论】:

标签: android-studio gradle android-gradle-plugin build.gradle android-multidex


【解决方案1】:

当我们添加 compile ('com.android.support:multidex:1.0.1'),然后会添加其他内容,所以我通过更改解决了我的问题

compile ('com.android.support:multidex:1.0.1')

androidTestCompile('com.android.support:multidex:1.0.1') { exclude group: 'com.android.support', module: 'support-annotations' }

【讨论】:

    猜你喜欢
    • 2016-01-07
    • 2016-02-22
    • 1970-01-01
    • 2016-02-09
    • 2016-06-12
    • 1970-01-01
    • 2019-05-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多