如何从android中gradle依赖添加的外部库目录中删除jar文件? [英] How to remove a jar file from the external libraries directory, which is added by the gradle dependency, in android?
本文介绍了如何从android中gradle依赖添加的外部库目录中删除jar文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
首先我在gradle中添加了一个依赖,然后同步项目.我们没有错误,但是当我们运行应用程序时,我们得到了一个错误,该错误也显示在图像中.
First, I have added a dependency in gradle, and then sync the project. We have no error, but when we run the application, we got an error which is also showing in the image.
:app:transformClassesWithJarMergingForDebug FAILED
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: javax/inject/Inject.class
我们发现了上面突出显示的不同版本的重复 jar 文件.现在我只想删除这个重复的 jar 文件(java.inject-1
).希望有人对此有解决方案.
We found a duplicate jar file with different version which is highlighted above. Now I want to remove only this duplicate jar file(java.inject-1
).
Hope someone has a solution for this.
推荐答案
请在您的 gradle
依赖项中尝试以下内容.
please try below in your gradle
dependency.
compile('org.igniterealtime:rest-api-client:1.1.3')
{exclude module: "javax.inject"}
这篇关于如何从android中gradle依赖添加的外部库目录中删除jar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文