2010-03-05 46 views
2

我不能編譯我的Android項目的Dalvik虛擬機,因爲這種錯誤的APK:無法生成因爲麻煩處理「爪哇/ AWT/FONT/NumericShaper.class」

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

我找到了我的問題的答案here。有時候,如果你只是使用eclipse中的修復項目設置功能。 Eclipse會將第二個Android jar放到源代碼樹中。我在google庫中找到了一個android.jar和另一個android.jar。我刪除了一個並擺脫了錯誤。

2

此錯誤不是由導入引起的,它是由代碼引起的。您的構建的源代碼爲java.awt.font.NumericShaper或正在嘗試加載具有java.awt.font.NumericShaper的JAR。假設您沒有將此代碼放到源代碼樹中,請檢查您的libs/目錄中的JAR(以及Eclipse中的任何添加到構建路徑的內容)。

1

我找到了解決辦法:

在你的項目屬性,一定要在Java構建路徑>訂單ANS出口的「的android.jar」沒有被選中。

希望有幫助,