繁体   English   中英

尝试为应用构建APK时出错

[英]Error when trying to build APK for app

当我尝试在Android Studio中构建应用程序时收到此错误

错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:retrofit2 / BuiltInConverters $ BufferingResponseBodyConverter.class

这是我的依赖项:

compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.google.firebase:firebase-core:9.0.2'
compile 'com.google.firebase:firebase-analytics:9.0.2'
compile 'com.google.firebase:firebase-config:9.0.2'
compile 'com.google.firebase:firebase-auth:9.0.2'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.android.gms:play-services-appindexing:9.0.2'
compile 'com.google.firebase:firebase-database:9.0.2'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.android.gms:play-services-maps:9.0.2'
compile 'com.android.support.constraint:constraint-layout:+'
compile 'com.android.support:multidex:1.0.1'

似乎某些jar文件未正确编译。

尝试清理或重建项目

如果这无助于删除jar文件,然后尝试再次添加它

我相信这会有所帮助

您显示的内容看起来不错。

根据错误,您有重复的转换器类。

删除libs文件夹中的所有翻新罐,然后再次运行gradle build

删除您单独添加的gson库。 只需要进行改造的那个。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM