2

由于此错误,我无法为 Dalvik VM 编译我的 Android 项目:

trouble processing "java/awt/font/NumericShaper.class":Attempt to include a core VM class in 
something other than a core library.
It is likely that you have attempted to include the core library from a desktop
virtual machine into an application, which will most assuredly not work. If
you really intend to build a core library -- which is only appropriate as
part of creating a full virtual machine binary, 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 please be aware that your build will still fail at some
point; you will simply be denied the pleasure of reading this helpful error
message.
[2010-03-05 16:33:23 - Notepadv2]1 error; aborting
[2010-03-05 16:33:23 - Notepadv2]Conversion to Dalvik format failed with error 1

我想我以某种方式搞砸了我的导入,但这个类从未出现在我的导入中。

4

3 回答 3

4

我在这里找到了我的问题的答案。有时,如果您只是使用 eclipse 中的修复项目设置功能,似乎有时。Eclipse 会将第二个 android jar 放入您的源代码树中。我在谷歌库下找到了一个 android.jar 和另一个。我删除了一个并摆脱了错误。

于 2010-03-05T16:41:39.690 回答
2

此错误不是由导入引起的,而是由代码引起的。您的构建要么具有源代码,java.awt.font.NumericShaper要么正在尝试加载具有java.awt.font.NumericShaper. 假设您没有将此代码放到源代码树中,请检查libs/目录中的 JAR(对于 Eclipse,检查您添加到构建路径中的任何内容)。

于 2010-03-05T16:04:16.710 回答
1

我找到了解决方案:

在您的项目属性中,确保在 Java Build Path > Order ans Export 中未选中“android.jar”。

希望有帮助,

于 2012-12-18T15:19:51.930 回答