tags:

views:

185

answers:

2

I can't compile my Android project for the Dalvik VM because of this error:

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

I think I somehow messed up my imports but this class never occurs in my imports.

+2  A: 

This error is not caused by imports, it is caused by code. Your build either has the source code to java.awt.font.NumericShaper or is attempting to load a JAR that has java.awt.font.NumericShaper. Assuming you did not drop this code into your source tree, check the JARs in your libs/ directory (and, in the case of Eclipse, anything you added to your build path).

CommonsWare
+1  A: 

I found the answer to my problem here. It seems that sometimes if you simply use the fix project setup feature from eclipse. Eclipse will drop a second android jar into your source tree. I found a single android.jar and another one under google libraries. I removed one and got rid of the error.

Janusz