java–common.annotations.Beta的TransformException重复条目

java–common.annotations.Beta的TransformException重复条目,第1张

概述这是在我添加google-api-services-calendar时开始的.我在尝试构建时收到此错误:Error:Executionfailedfortask':app:transformClassesWithJarMergingForDebug'.com.android.build.transform.api.TransformException:java.util.zip.ZipException:duplicateentry

这是在我添加Google-API-services-calendar时开始的.我在尝试构建时收到此错误:

Error:Execution Failed for task ':app:transformClassesWithJarMergingForDeBUG'.     com.androID.build.transform.API.transformException: java.util.zip.ZipException:      duplicate entry: com/Google/common/annotations/Beta.class

这是运行./gradlew app:dependencIEs时输出的一部分:

compile - Classpath for compiling the main sources.+--- com.Google.androID.gms:play-services-measurement:8.1.0|    +--- com.Google.androID.gms:play-services-base:8.1.0|    |    \--- com.Google.androID.gms:play-services-basement:8.1.0|    |         \--- com.androID.support:support-v4:22.2.0 -> 23.0.1|    |              \--- com.androID.support:support-annotations:23.0.1|    \--- com.Google.androID.gms:play-services-analytics:8.1.0|         +--- com.Google.androID.gms:play-services-basement:8.1.0 (*)|         \--- com.Google.androID.gms:play-services-ads:8.1.0|              +--- com.Google.androID.gms:play-services-basement:8.1.0 (*)|              \--- com.Google.androID.gms:play-services-appindexing:8.1.0|                   \--- com.Google.androID.gms:play-services-basement:8.1.0 (*)+--- com.Google.dagger:dagger:2.0|    \--- javax.inject:javax.inject:1+--- com.Google.androID.gms:play-services-IDentity:8.1.0|    \--- com.Google.androID.gms:play-services-base:8.1.0 (*)+--- com.Google.androID.gms:play-services-plus:8.1.0|    \--- com.Google.androID.gms:play-services-base:8.1.0 (*)+--- com.Google.androID.gms:play-services:8.1.0|    +--- com.Google.androID.gms:play-services-ads:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-analytics:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-appindexing:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-appinvite:8.1.0|    |    \--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-appstate:8.1.0|    |    \--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-basement:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-cast:8.1.0|    |    +--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    |    \--- com.androID.support:mediarouter-v7:22.2.0|    |         \--- com.androID.support:appcompat-v7:22.2.0 -> 23.0.1|    |              \--- com.androID.support:support-v4:23.0.1 (*)|    +--- com.Google.androID.gms:play-services-drive:8.1.0|    |    \--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-fitness:8.1.0|    |    +--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    |    \--- com.Google.androID.gms:play-services-location:8.1.0|    |         +--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    |         \--- com.Google.androID.gms:play-services-maps:8.1.0|    |              \--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-games:8.1.0|    |    +--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    |    \--- com.Google.androID.gms:play-services-drive:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-gcm:8.1.0|    |    \--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-IDentity:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-location:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-maps:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-measurement:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-nearby:8.1.0|    |    \--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-panorama:8.1.0|    |    \--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-plus:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-safetynet:8.1.0|    |    \--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-vision:8.1.0|    |    \--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    +--- com.Google.androID.gms:play-services-wallet:8.1.0|    |    +--- com.Google.androID.gms:play-services-base:8.1.0 (*)|    |    +--- com.Google.androID.gms:play-services-IDentity:8.1.0 (*)|    |    \--- com.Google.androID.gms:play-services-maps:8.1.0 (*)|    \--- com.Google.androID.gms:play-services-wearable:8.1.0|         \--- com.Google.androID.gms:play-services-base:8.1.0 (*)+--- com.Google.guava:guava:18.0+--- com.Google.maps.androID:androID-maps-utils:0.4+--- com.Google.APIs:Google-API-services-calendar:v3-rev125-1.20.0|    \--- com.Google.API-clIEnt:Google-API-clIEnt:1.20.0|         +--- com.Google.oauth-clIEnt:Google-oauth-clIEnt:1.20.0|         |    +--- com.Google.http-clIEnt:Google-http-clIEnt:1.20.0|         |    |    \--- com.Google.code.findBUGs:Jsr305:1.3.9|         |    \--- com.Google.code.findBUGs:Jsr305:1.3.9|         +--- com.Google.http-clIEnt:Google-http-clIEnt-jackson2:1.20.0|         |    +--- com.Google.http-clIEnt:Google-http-clIEnt:1.20.0 (*)|         |    \--- com.fasterxml.jackson.core:jackson-core:2.1.3 -> 2.2.2|         \--- com.Google.guava:guava-jdk5:13.0+--- com.androID.support:design:23.0.1|    +--- com.androID.support:support-v4:23.0.1 (*)|    \--- com.androID.support:appcompat-v7:23.0.1 (*)+--- com.androID.support:recyclervIEw-v7:23.0.1|    +--- com.androID.support:support-v4:23.0.1 (*)|    \--- com.androID.support:support-annotations:23.0.1+--- com.androID.support:cardvIEw-v7:23.0.1+--- com.androID.support:palette-v7:23.0.1|    \--- com.androID.support:support-v4:23.0.1 (*)+--- com.androID.support:appcompat-v7:22.2.0 -> 23.0.1 (*)+--- com.androID.support:support-v4:22.2.0 -> 23.0.1 (*)+--- com.firebase:firebase-clIEnt-androID:2.3.1|    \--- com.firebase:firebase-clIEnt-jvm:2.3.1|         +--- com.fasterxml.jackson.core:jackson-databind:2.2.2|         |    +--- com.fasterxml.jackson.core:jackson-annotations:2.2.2|         |    \--- com.fasterxml.jackson.core:jackson-core:2.2.2|         \--- com.firebase:tubesock:0.0.11+--- com.firebase:firebase-clIEnt-jvm:2.3.0 -> 2.3.1 (*)+--- net.danlew:androID.joda:2.8.0|    \--- joda-time:joda-time:2.8+--- org.joda:joda-convert:1.2+--- com.squareup:otto:1.3.5+--- com.jakewharton:butterknife:7.0.1+--- org.apache.commons:commons-lang3:3.4+--- org.apache.commons:commons-collections4:4.0\--- com.bignerdranch.androID:expandablerecyclervIEw:1.0.3     \--- com.androID.support:recyclervIEw-v7:22.2.0 -> 23.0.1 (*)

我尝试将其添加到我的所有依赖项中:

compile (some.dependencIE.that.may.or.may.not.have.the.duplicate){    exclude group: 'com.Google.common', module: 'annotations'}

我尝试将其添加到我的androID块:

configurations {   all*.exclude group: 'com.Google.common', module: 'annotations'}    

有这些变化:

 all*.exclude module: 'annotations` all*.exclude group: 'com.Google.common' all*.exclude group: 'com.Google.common.annotations'

在尝试修复错误之前,这是build.gradle:

dependencIEs {    compile filetree(dir: 'libs', include: ['*.jar'])    // Google    compile 'com.Google.dagger:dagger:2.0'    apt 'com.Google.dagger:dagger-compiler:2.0'    compile 'com.Google.androID.gms:play-services-IDentity:8.1.0'    compile 'com.Google.androID.gms:play-services-plus:8.1.0'    compile 'com.Google.androID.gms:play-services:8.1.0'    compile 'com.Google.guava:guava:18.0'    compile 'com.Google.maps.androID:androID-maps-utils:0.4'    compile('com.Google.APIs:Google-API-services-calendar:v3-rev125-1.20.0') {        exclude group: 'org.apache.httpcomponents', module: 'httpclIEnt'    }    // AndroID Design    compile 'com.androID.support:design:23.0.1'    compile 'com.androID.support:recyclervIEw-v7:23.0.1'    compile 'com.androID.support:cardvIEw-v7:23.0.1'    compile 'com.androID.support:palette-v7:23.0.1'    // AndroID Support    compile('com.androID.support:appcompat-v7:22.2.0') {        exclude group: 'org.apache.httpcomponents', module: 'httpclIEnt'    }    compile('com.androID.support:support-v4:22.2.0') {        exclude group: 'org.apache.httpcomponents', module: 'httpclIEnt'    }    // Firebase    compile('com.firebase:firebase-clIEnt-androID:2.3.1') {        exclude group: 'org.apache.httpcomponents', module: 'httpclIEnt'    }    compile('com.firebase:firebase-clIEnt-jvm:2.3.0') {        exclude group: 'org.apache.httpcomponents', module: 'httpclIEnt'    }    // Joda Time    compile 'net.danlew:androID.joda:2.8.0'    compile 'org.joda:joda-convert:1.2'    // Square    compile 'com.squareup:otto:1.3.5'    compile 'com.jakewharton:butterknife:7.0.1'    provIDed 'javax.annotation:Jsr250-API:1.0'    // Common    compile 'org.apache.commons:commons-lang3:3.4'    compile 'org.apache.commons:commons-collections4:4.0'    compile 'com.bignerdranch.androID:expandablerecyclervIEw:1.0.3'}

我在我的项目中搜索了Beta.class,发现它只在一些罐子里使用过; com.Google.common.annotations,com.Google.API.clIEnt.util和dagger.internal.我尝试将排除组添加到那些相关的依赖项中,但仍然看到相同的错误.

我被困在这里太久了.有什么建议?

解决方法:

从播放服务相关的依赖项中排除组:“com.Google.guava”.

例如:

compile ('com.Google.androID.gms:play-services:8.1.0'){    exclude group: 'com.Google.guava'}

附:在收到错误之前,我遇到了很多不同的问题,所以我的最终依赖列表是:

dependencIEs {    compile filetree(dir: 'libs', include: ['*.jar'])    // Google    compile 'com.Google.dagger:dagger:2.0'    apt 'com.Google.dagger:dagger-compiler:2.0'    compile ('com.Google.androID.gms:play-services-IDentity:8.1.0'){        exclude group: 'com.Google.guava'    }    compile ('com.Google.androID.gms:play-services-plus:8.1.0'){        exclude group: 'com.Google.guava'    }    compile ('com.Google.androID.gms:play-services:8.1.0'){        exclude group: 'com.Google.guava'    }    compile 'com.Google.guava:guava:18.0'    compile 'com.Google.maps.androID:androID-maps-utils:0.4'    compile('com.Google.APIs:Google-API-services-calendar:v3-rev125-1.20.0') {        exclude group: 'org.apache.httpcomponents'        exclude group: 'com.androID.support'        exclude module: 'support-annotations'        exclude group: 'com.Google.guava'    }    // AndroID Design    compile ('com.androID.support:design:23.0.1'){        exclude group: 'com.androID.support'    }    compile ('com.androID.support:recyclervIEw-v7:23.0.1') {        exclude group: 'com.androID.support'    }    compile 'com.androID.support:cardvIEw-v7:23.0.1'    compile ('com.androID.support:palette-v7:23.0.1'){        exclude group: 'com.androID.support'    }    // AndroID Support    compile('com.androID.support:appcompat-v7:22.2.0') {        exclude group: 'org.apache.httpcomponents', module: 'httpclIEnt'        exclude group: 'com.androID.support'    }    compile 'com.androID.support:support-annotations:23.0.1'    compile('com.androID.support:support-v4:22.2.0') {        exclude group: 'org.apache.httpcomponents', module: 'httpclIEnt'        exclude module: 'support-annotations'    }    // Firebase    compile('com.firebase:firebase-clIEnt-androID:2.3.1') {        exclude group: 'org.apache.httpcomponents', module: 'httpclIEnt'    }    compile('com.firebase:firebase-clIEnt-jvm:2.3.0') {        exclude group: 'org.apache.httpcomponents', module: 'httpclIEnt'    }    // Joda Time    compile 'net.danlew:androID.joda:2.8.0'    compile 'org.joda:joda-convert:1.2'    // Square    compile 'com.squareup:otto:1.3.5'    compile 'com.jakewharton:butterknife:7.0.1'    provIDed 'javax.annotation:Jsr250-API:1.0'    // Common    compile 'org.apache.commons:commons-lang3:3.4'    compile 'org.apache.commons:commons-collections4:4.0'    compile ('com.bignerdranch.androID:expandablerecyclervIEw:1.0.3'){        exclude group: 'com.androID.support'    }}
总结

以上是内存溢出为你收集整理的java – common.annotations.Beta的TransformException重复条目全部内容,希望文章能够帮你解决java – common.annotations.Beta的TransformException重复条目所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1103539.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-28
下一篇2022-05-28

发表评论

登录后才能评论

评论列表(0条)

    保存