2011-04-21 110 views
2

當設置我的機器在Android上工作我不能讓代碼「編譯」,或者它正在編譯和停止在其他一些進程,因爲它當它說「生成classes.dex」時會給出錯誤。Android編譯錯誤,當「生成classes.dex ....」

我得到的錯誤是:

Information: Note: Some input files use unchecked or unsafe operations. 
Information: Note: Recompile with -Xlint:unchecked for details. 
Information: Compilation completed with 12 errors and 2 warnings 
Information: 12 errors 
Information: 1 warning 
Error: (org.joda.time.DateTimeZone$1) that doesn't come with an 
Error: associated EnclosingMethod attribute. This class was probably produced by a 
Error: compiler that did not target the modern .class file format. The recommended 
Error: solution is to recompile the class from source, using an up-to-date compiler 
Error: and without specifying any "-target" type options. The consequence of ignoring 
Error: this warning is that reflective operations on this class will incorrectly 
Error: indicate that it is *not* an inner class. 
Error: (junitx.extensions.TestSetup$1) that doesn't come with an 
Error: (junitx.ant.TestClassValidatorTask$1) that doesn't come with an 
Error: (junitx.util.AbstractSuiteBuilder$1) that doesn't come with an 
Error: (junitx.framework.TestSuite$1) that doesn't come with an 
Error: (junitx.tool.TestClassValidator$1) that doesn't come with an 
Warning: warning: Ignoring InnerClasses attribute for an anonymous inner class 

有趣的是,該代碼在我們那是建立looong時間以前,沒人記得這事的另一臺計算機編譯正確。

我瘋狂搜索,每個人都說你需要從源代碼JodaTime和其他任何東西重新編譯,但這不可能是這種情況,因爲相同的代碼(複製並粘貼或從版本控制下載)完美地工作在另一個機器,所以必須對我的環境造成影響,但我不知道要尋找什麼。

那裏的任何專家認識到這種類型的錯誤?
你有過這種事嗎?你怎麼修好它的 ??

請幫助...

注:
- 使用的是IntelliJ
- 編譯爲Android 1.6

之前有人指出出來,我知道了類似的問題已經被問過。這裏例如:Recompile jodatime?。但在這種情況下,擬議的解決方案是重新編譯JodaTime的來源。我認爲這不是這種情況,因爲代碼在一臺計算機中運行,而不是在另一臺計算機上運行。

+0

你使用的是eclipse嗎? – bytebender 2011-04-21 15:35:44

+0

我正在使用Intellij。 – bluediapente 2011-04-21 15:46:38

+0

可能與您正在使用的jdk版本有關。你可以檢查您的計算機上的jdk版本,以及它工作的另一個版本 – Josnidhin 2011-04-25 14:36:31

回答

1

您是否嘗試過更新IntelliJ?

我不是專家,但幾天前我遇到了同樣的問題,花了很長時間才弄清楚它是什麼。 原來是IntelliJ版本。

只是通過更新到最新版本(每晚構建)才能正常工作。

+0

修復它!我使用10.0.0版本並更新到10.0.3,前者是一個錯誤,後者只是一個警告,我終於可以編譯。謝謝!! – bluediapente 2011-04-26 02:07:43

0

我收到了同樣的錯誤信息,結果是它包含了兩個聲明相同類的庫(例如庫的舊版本和新版本)。不知道錯誤消息是如何與之相關的,但刪除舊版本解決了我的問題。