【问题标题】:gradle error "ZipException: duplicate entry: org/apache/ftpserver/ftplet/Authentication.class" with apache commons ftp带有 apache commons ftp 的 gradle 错误“ZipException:重复条目:org/apache/ftpserver/ftplet/Authentication.class”
【发布时间】:2018-10-22 18:11:32
【问题描述】:

我正在尝试使用 gradle 构建我的项目,但收到以下错误消息:

错误:任务 ':app:transformClassesWithJarMergingForDebug' 执行失败。 com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:org/apache/ftpserver/ftplet/Authentication.class

所以,我认为 Authentication.class 文件不仅仅存在于 ftp 库中,但我不知道如何解决这个错误。

我的 gradle.build 依赖项:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:design:23.3.0'
    compile 'com.android.support:support-v4:23.3.0'
    compile 'org.apache.ftpserver:ftpserver-core:1.0.6'
    compile 'cc.mvdan.accesspoint:library:0.2.0'
}

如何解决?

【问题讨论】:

  • 你的lib文件夹里有jar吗?
  • 您可以打开Android Studio右侧的Gradle窗口并运行help > dependencies。否则,更多选项在my post here 中讨论

标签: android gradle


【解决方案1】:

问题来自 ftpserver-core 依赖。 我不得不从 gradle 中的 ftpserver-core 依赖中排除 ftplet-api 模块,因为 fplet-api 被添加了两次。

【讨论】:

  • 你是如何排除模块的?可以举个gradle sn-p的例子吗?
  • @ZdravkoDonev 我两年前离开了公司,所以我不能带正确的sn-p,对不起。你可以在这里找到帮助:docs.gradle.org/current/userguide/…
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-12-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-01-24
相关资源
最近更新 更多