错误 - zip文件app -debug.apk已经包含条目' dex.dex',无法覆盖
我在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也有这个错误。
在我的情况下,我尝试将一个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.