故障处理"使用javax / XML / XMLConstants.class" [英] Trouble Processing "javax/xml/XMLConstants.class"

查看:849
本文介绍了故障处理"使用javax / XML / XMLConstants.class"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始了一个新的Andr​​oid项目。该项目引用一个第三方JAR,反过来引用其他4个罐子:

I'm starting out a new Android project that. The project is referencing one third-party JAR that in turn references 4 other jars:

ws-commons-java5-1.0.1.jar
ws-commons-util-1.0.2.jar
xmlrpc-client-3.1.3.jar
xmlrpc-common-3.1.3.jar

据我所知道的,我觉得这4个罐子是标准的Java类,我认为。不管怎么说,我有五个这些罐子(4 +以上的1第三方JAR)在我的构建路径。当我尝试运行我的Andr​​oid应用程序,我得到:

As far as I can tell, I think these 4 jars are standard Java classes I think. Anyways, I have all five of these jars (the 4 above + the 1 third party jar) in my Build Path. When I attempt to run my Android app, I get:

Dx 
trouble processing "javax/xml/XMLConstants.class":

Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.

This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.

However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.

If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.

If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.

If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.

[2012-03-21 23:05:05 - MyApp ] Dx 1 error; aborting
[2012-03-21 23:05:05 - MyApp ] Conversion to Dalvik format failed with error 1

我不知道这里做什么。这就像它问我,如果我试图建立一个核心库,我不是。我只是想在我的项目中使用这些JAR。有另一种方法,我应该引用我的项目这些JAR?该错误使得它听起来像我的项目是要随机停止的人工作一天。

I'm not sure what to do here. It's like it's asking me if I'm trying to build a core-library, which I'm not. I'm just trying to use these JARs in my project. Is there another way I should be referencing these JARs in my project? The error makes it sound like my project is going to randomly stop working for someone someday.

这是一切都非常混乱。如何正确进行任何线索?

This is all very confusing. Any clues on how to properly proceed?

推荐答案

有上等等一些类似的问题报告(与其他类,但同一类型的消息),并藏在一个<一个评论href=\"http://stackoverflow.com/questions/5637707/conversion-to-dalvik-format-failed-with-error-1\">closed问题我发现了一个指向外部站点上的解决方案:

There are some similiar problem reports on SO (with other classes but the same type of message ) and hidden in one comment to a closed question I found a pointer to a solution on an external site:

不明智的或错误的核心类的使用

这篇关于故障处理&QUOT;使用javax / XML / XMLConstants.class&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆