天天看点

Eclipse开发Android时报错Unable to execute dex: Multiple dex files define

在我开发是导入了两个jar包htmllexer.jar和htmlparser.jar,他们中存在相同的类,导致报错

报错信息:

[2014-10-22 11:42:36 - VoaLearning] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class

(org.htmlparser.util.NodeList$1) that doesn't come with an

associated EnclosingMethod attribute. This class was probably produced by a

compiler that did not target the modern .class file format. The recommended

solution is to recompile the class from source, using an up-to-date compiler

and without specifying any "-target" type options. The consequence of ignoring

this warning is that reflective operations on this class will incorrectly

indicate that it is *not* an inner class.

[2014-10-22 11:42:36 - VoaLearning] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class

(org.htmlparser.beans.BeanyBaby$1) that doesn't come with an

associated EnclosingMethod attribute. This class was probably produced by a

compiler that did not target the modern .class file format. The recommended

solution is to recompile the class from source, using an up-to-date compiler

and without specifying any "-target" type options. The consequence of ignoring

this warning is that reflective operations on this class will incorrectly

indicate that it is *not* an inner class.

[2014-10-22 11:42:39 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/htmlparser/util/SimpleNodeIterator;

[2014-10-22 11:42:39 - VoaLearning] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/htmlparser/util/SimpleNodeIterator;

分析:两个包有相同的类htmlparser/util/SimpleNodeIterator

解决方法:删除其中一个包的类;

(zip软件查看jar包,直接把htmlparser下面的util中的SimpleNodeIterator.class文件给删除了,然后再导入到eclipse中。)