gpt4 book ai didi

android - Error :Execution failed for task ':app:transformClassesWithJarMergingForDebug' 的解决方法是什么

转载 作者:行者123 更新时间:2023-11-30 00:10:35 27 4
gpt4 key购买 nike

我已经尝试编译并且没有错误,但是当我想运行该应用程序时却出现了这个错误:

Error:Execution failed for task 
':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException:
java.util.zip.ZipException: duplicate entry:
com/google/gson/annotations/Expose.class

我的依赖是:

    compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-
core:2.2.2', {
exclude group: 'com.android.support', module: 'support-
annotations'
})
compile files('src/include/gson-2.8.2-SNAPSHOT.jar')
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:23.2.0'
compile 'io.searchbox:jest-droid:2.0.1'
testCompile 'junit:junit:4.12'

最佳答案

我注意到您的问题与 this 重复

正如该问题中已接受的答案所述,您必须在此处多次编译 GSON

compile files('src/include/gson-2.8.2-SNAPSHOT.jar')

在另一个图书馆...我假设是这个图书馆:

compile 'io.searchbox:jest-droid:2.0.1'

所以我建议为您的项目复制已接受的答案,如下所示:

compile('io.searchbox:jest-droid:2.0.1') {
exclude module: 'gson'
}

关于android - Error :Execution failed for task ':app:transformClassesWithJarMergingForDebug' 的解决方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48195779/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com