当前位置: 首页 > 面试题库 >

试图修复“错误建议或错误使用核心类”的Android失败了

陈阳舒
2023-03-14
问题内容

在尝试从网上看到的问题自行解决此问题后,我仍然无法弄清这意味着什么:

[2013-08-15 23:58:27 - StudioTab] 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.

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.

[2013-08-15 23:58:27 - StudioTab] Dx 1 error; aborting
[2013-08-15 23:58:27 - StudioTab] Conversion to Dalvik format failed with error 1

我不知道这到底在告诉我什么,或者从哪里开始看。我是否以某种方式递归地包含一个库?我的订单和出口下的构建路径如下:

Google APIs [Android 3.0]
Android Dependencies
   annotations.jar
Android Private Libraries
    A ton of jars for various functionality i need: CSV writing, talking to the           google calendar somehow...etc...etc.  They are jars I found on the net, not ripped from another project but found to solve problems i.e. how to access google calendar from the device and read/write to it etc...  is this where my problem lies? I can provide a complete list of the jars I am using here.
android-support-v4.jar

我自己添加了一个作为外部jar。我忘记了它的用途,但是如果删除它,它就不能使用诸如FragmentActivity之类的怪异东西。

所以我什至开始寻找它,以便我可以再次选择备份该项目…让它在模拟器上编译并运行。

LIBS文件夹如下:驱动器D中的卷为LargeWorkDisk卷序列号为206C-D951

     Directory of D:\Programming\StudioTab\libs

    08/16/2013  12:39 AM    <DIR>          .
    08/16/2013  12:39 AM    <DIR>          ..
    08/15/2013  09:45 PM         1,700,072 android-1.5_r4-sources.jar
    08/15/2013  09:45 PM         2,136,034 android-1.5_r4.jar
    08/15/2013  09:45 PM            55,191 commons-codec-1.3-sources.jar
    08/15/2013  09:45 PM            46,725 commons-codec-1.3.jar
    08/15/2013  09:45 PM            74,976 commons-logging-1.1.1-sources.jar
    08/15/2013  09:45 PM            60,686 commons-logging-1.1.1.jar
    08/15/2013  09:45 PM            53,983 google-api-client-1.5.0-beta-sources.jar
    08/15/2013  09:45 PM            44,653 google-api-client-1.5.0-beta.jar
    08/15/2013  09:45 PM            13,356 google-api-client-extensions-1.5.0-beta-sources.jar
    08/15/2013  09:45 PM            15,276 google-api-client-extensions-1.5.0-beta.jar
    08/15/2013  09:45 PM             3,459 google-api-client-extensions-android2-1.5.0-beta-sources.jar
    08/15/2013  09:45 PM             4,556 google-api-client-extensions-android2-1.5.0-beta.jar
    08/15/2013  09:45 PM           309,295 google-collections-1.0-sources.jar
    08/15/2013  09:45 PM           639,592 google-collections-1.0.jar
    08/15/2013  09:45 PM           188,771 google-http-client-1.5.0-beta-sources.jar
    08/15/2013  09:45 PM           196,915 google-http-client-1.5.0-beta.jar
    08/15/2013  09:45 PM             6,433 google-http-client-extensions-1.5.0-beta-sources.jar
    08/15/2013  09:45 PM             7,807 google-http-client-extensions-1.5.0-beta.jar
    08/15/2013  09:45 PM             3,021 google-http-client-extensions-android2-1.5.0-beta-sources.jar
    08/15/2013  09:45 PM             3,854 google-http-client-extensions-android2-1.5.0-beta.jar
    08/15/2013  09:45 PM             6,638 google-http-client-extensions-android3-1.5.0-beta-sources.jar
    08/15/2013  09:45 PM            10,418 google-http-client-extensions-android3-1.5.0-beta.jar
    08/15/2013  09:45 PM            35,765 google-oauth-client-1.5.0-beta-sources.jar
    08/15/2013  09:45 PM            34,394 google-oauth-client-1.5.0-beta.jar
    08/15/2013  09:45 PM            38,030 google-oauth-client-extensions-1.5.0-beta-sources.jar
    08/15/2013  09:45 PM            48,289 google-oauth-client-extensions-1.5.0-beta.jar
    08/15/2013  09:45 PM           140,057 gson-1.6-sources.jar
    08/15/2013  09:45 PM           164,984 gson-1.6.jar
    08/15/2013  09:45 PM           640,031 guava-r09-sources.jar
    08/15/2013  09:45 PM         1,143,921 guava-r09.jar
    08/15/2013  09:45 PM           390,195 httpclient-4.0.3-sources.jar
    08/15/2013  09:45 PM           292,893 httpclient-4.0.3.jar
    08/15/2013  09:45 PM           291,844 httpcore-4.0.1-sources.jar
    08/15/2013  09:45 PM           172,888 httpcore-4.0.1.jar
    08/15/2013  09:45 PM           200,880 jackson-core-asl-1.6.7-sources.jar
    08/15/2013  09:45 PM           201,086 jackson-core-asl-1.6.7.jar
    08/15/2013  09:45 PM           283,945 jdo2-api-2.3-eb-sources.jar
    08/15/2013  09:45 PM           192,820 jdo2-api-2.3-eb.jar
    08/15/2013  09:45 PM           476,722 joda-time-1.6-sources.jar
    08/15/2013  09:45 PM           534,827 joda-time-1.6.jar
    08/15/2013  09:45 PM            39,665 jsontoken-1.0-sources.jar
    08/15/2013  09:45 PM            37,877 jsontoken-1.0.jar
    08/15/2013  09:45 PM            33,015 jsr305-1.3.9.jar
    08/15/2013  09:45 PM           147,086 junit-4.8.2-sources.jar
    08/15/2013  09:45 PM           237,344 junit-4.8.2.jar
    08/16/2013  12:39 AM                 0 libsdir.txt
    08/15/2013  09:45 PM            11,358 LICENSE
    08/15/2013  09:45 PM            14,146 opencsv-2.3.jar
    08/15/2013  09:45 PM            12,986 opengl-api-gl1.1-android-2.1_r1-sources.jar
    08/15/2013  09:45 PM            18,492 opengl-api-gl1.1-android-2.1_r1.jar
    08/15/2013  09:45 PM           125,968 ormlite-android-4.24-javadoc.jar
    08/15/2013  09:45 PM            22,285 ormlite-android-4.24-sources.jar
    08/15/2013  09:45 PM            32,707 ormlite-android-4.24.jar
    08/15/2013  09:45 PM           216,486 ormlite-core-4.24.jar
    08/15/2013  09:45 PM           140,718 protobuf-java-2.2.0-sources.jar
    08/15/2013  09:45 PM           320,306 protobuf-java-2.2.0.jar
    08/15/2013  09:45 PM               501 readme.html
    08/15/2013  09:45 PM           158,114 servlet-api-2.5-sources.jar
    08/15/2013  09:45 PM           105,112 servlet-api-2.5.jar
    08/15/2013  09:45 PM            25,014 transaction-api-1.1-sources.jar
    08/15/2013  09:45 PM            15,071 transaction-api-1.1.jar
    08/15/2013  09:45 PM           124,724 xmlParserAPIs-2.6.2.jar
    08/15/2013  09:45 PM           128,334 xpp3-1.1.4c-sources.jar
    08/15/2013  09:45 PM           120,069 xpp3-1.1.4c.jar
                  64 File(s)     12,952,660 bytes
                   2 Dir(s)  2,057,125,945,344 bytes free

问题答案:

Dalvik JVM不支持Oracle
JDK的整个API。我认为javax.*软件包不适用于Android。例如有没有AWTSwingGraphics2DJava程序的Android。

从该错误看来,您的应用程序正在使用此类:http
:
//docs.oracle.com/javase/7/docs/api/javax/xml/namespace/QName.html

如果将IDE设置为使用Android SDK而不是JDK,则不会发生这种情况。



 类似资料:
  • 我试图写一个宏,复制表格(颜色,格式等)从工作表的每一天(星期一,星期二,星期三,星期四和星期五)和粘贴到工作表(262个工作表)为同一天。(星期一-星期一等)表名我在表“数据”。

  • 我正在使用ASP.NET内核。我正在创建一个基本的WebAPI。我想在出现问题时显示一个JSON错误。 打印屏幕在我的屏幕上显示want I want。唯一的问题是它的发送状态码为200。 我可以通过这样做来解决问题: 真诚的,布莱希特

  • 我试图在调试模式下运行应用程序,但我得到以下错误: 下面是我的build.gradle文件: 这个错误快把我逼疯了,谁能帮帮我吗。我的代码达到了65K的限制,所以我添加了multiDexEnabled选项。

  • 问题内容: 我是python的新手,正在遇到一个奇怪的错误: 当我执行以下代码时: 这部分代码是从程序的stdout中读取的。当我在线程外执行 时,它将起作用!但是当我在fais线程中执行它时…有什么建议吗? 问题答案: 是当程序退出并带有信号并且启用了核心创建时Linux打印的字符串。这意味着 某些 程序已崩溃。 如果您实际上是通过运行Python遇到此错误,则意味着Python解释器已崩溃。发

  • 为什么我会出现以下错误?突然,它开始出现这个错误。 失败:生成失败,出现异常。 > 其中:脚本'C:\src\flutter\package\flutter_tools\gradle\flutter.gradle'行:1070 错误:任务:app:compileFlutterBuildDebug的执行失败。 处理“命令”C:\src\flatter\bin\flatter。bat“”以非零退出值1

  • 当我尝试构建我的android应用程序时,我如何修复这个问题。我将实现'com.google.android.gms:play-services-ads:19.8.0'更新为实现'com.google.android.gms:play-services-ads:20.4.0',现在我得到了这个错误。 jetified-play-services-measurement-18.0.2-runtime