Dalvik虚拟机错误:异常发现" Javax.xml.namespace.QName.class"虚拟机、异常、错误、发现

2023-09-05 02:00:31 作者:蓦然回首べ只为灯火阑珊

此并不打算成为一个问题。相反,观察其在Android中发现,当您使用外部API进行开发和的android.jar一个常见的​​问题是不是复制到您的项目!

This isn't intended to be a question. Rather, an observation which is a common problem found in Android when you use external APIs for development and android.jar isn't duplicated into your project!

推荐答案

通过各种论坛搜索后,谷歌和计算器,我似乎由我自己并分享其想法得到解决。

After searching through various forums, Google and stackoverflow, I seem to get a solution by myself and thought of sharing it.

每当你要链接外部库,更好地它通过创建/ lib文件夹和转储这些.jar文件有链接(指要复制文件,而不是链接它们)。使用的Eclipse它们连接 - >生成属性 - >配置构建路径 - >库选项卡 - >添加外部JAR 。添加保存在/ lib文件夹中这所需要的.jar文件。 (需要注意的是,罐子包括作为引用的库,在Eclipse将消失/ lib文件夹!但是,不要担心,因为适当的链接已经发生了。另一个需要注意的是,检查/ lib下的jar所引用不应该在构建属性,因为它会被继承的库选项卡中。)

Whenever you are linking external libraries, better link it by creating a /lib folder and dump those .jars there(means to COPY the files and NOT linking them). Link them using Eclipse -> Build Properties -> Configure Build path -> Library tab -> Add external Jars. Add the required .jars saved in /lib folder in this. (Note that, the jar included as a "Referenced Library" in Eclipse will disappear in /lib folder! But, not to worry as proper linking has happened. Another note is to check that the /lib jar that was referenced should NOT be visible in Libraries tab of Build Properties as it will be inherited.)

在正在使用谷歌API的另一个主要问题是。特别是孩子,就是用java /使用javax的一些核心库函数。要特别小心这一点。该错误是,在DalvikVM试图联系这些,但未按发现某重复,无法决定哪一个参考。以下是错误。

Another major problem was when Google APIs are being used. Specially the ones, which use some core library functions of java/javax. Be very careful of this. The error is that, the DalvikVM tries to link these but fails as there is a duplication found and is unable to decide which one to refer to. Below is the error.

Dx trouble processing "javax/xml/namespace/QName.class": 
Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library.

在这种情况下,我所观察到的是,这个类是用在 xpp3-1.1.4c.jar。如果你复制这到你的/ lib文件夹,请排除。然后清理项目,并给予了新的版本。而开航后顺利。

In such cases, what I have observed is that, this class is used in xpp3-1.1.4c.jar. If you've copied this into your /lib folder, PLEASE REMOVE IT. Then clean the project, and give a fresh build. And the ship sails smoothly thereafter.

这样做对其他引用的.jar文件,如果这种重复的存在。

Do this for other referenced .jars if such duplication exists.

干杯!