简体   繁体   English

路标和gdata jar出现多个dex文件错误

[英]Multiple dex files error with signpost and gdata jars

My app requires both signpost-core-1.2.1.2.jar and one of Google's libraries gdata-core-1.0.jar . 我的应用程序同时需要gdata-core-1.0.jar signpost-core-1.2.1.2.jar和Google的一个库gdata-core-1.0.jar But the signpost jar has some of the classes packaged in the gdata-core package. 但是路标jar有一些打包在gdata-core包中的类。 So, my app project is not building. 因此,我的应用程序项目没有建立。 Here is the error: 这是错误:

 Unable to execute dex: Multiple dex files define Lcom/google/gdata/util/common/base/Escaper;

How can I fix this conflict.. I need both the jars for different purposes within my app. 我该如何解决此冲突。.我需要在我的应用中同时使用这两个jar,以用于不同的目的。

You can still keep two jars, but you would need to modify / repackage one of them to resolve runtime conflicts 您仍然可以保留两个jar,但是您需要修改/重新打包其中一个以解决运行时冲突

  • You need to decide what jar you will use for that conflicting class 您需要确定将在该冲突类中使用哪个jar
  • Open one of jars with 7zip (or alternative) and remove the path\\to\\Conflict.class file 用7zip(或替代方法)打开一个罐子,然后删除path \\ to \\ Conflict.class文件
  • save the new jar 保存新的罐子
  • update classpath to include new jar in your IDE 更新类路径以在IDE中包含新的jar

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

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