错误 - zip文件app -debug.apk已经包含条目' dex.dex',无法覆盖

发布于 2025-02-10 22:52:28 字数 747 浏览 1 评论 0原文

我在app/libs dir中导入了一个jar文件,并将其添加为build.gradle文件中的库。但是,当我构建项目时,会出现错误 -

Zip file 'E:\AndroidProjects\testing\app\build\intermediates\apk\debug\app-debug.apk' already contains entry 'classes.dex', cannot overwrite

注意 - 此jar文件是在另一个环境中创建的/具有不同的签名。

implementation files('libs/myjar.jar')

这个问题看起来像 this and this - 我尝试删除/清洁构建文件夹,但此错误是不走了。我还尝试将Gradle版本更改为最新的7.2.1。

I imported a jar file in app/libs dir and added it as a library in build.gradle file. But when I am building the project getting errors -

Zip file 'E:\AndroidProjects\testing\app\build\intermediates\apk\debug\app-debug.apk' already contains entry 'classes.dex', cannot overwrite

Note - This jar file is created in another environment/ having a different signature.

implementation files('libs/myjar.jar')

This issue looks like this and this - and I have tried deleting/ cleaning the build folder but this error is not going away. I also tried changing the Gradle version to the latest 7.2.1.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌能量女王 2025-02-17 22:52:28

我也有这个错误。
在我的情况下,我尝试将一个JAR文件添加到包含class.dex文件的应用程序中。
我可以通过将编译为Java字节代码而不是DEX字节码的LIB添加来避免该错误。

I had this error too.
In my case i tried to add a jar file to my app containing a classes.dex file.
I could avoid that error by adding the lib compiled to java byte code rather than dex bytecode.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文