2013-08-18 47 views
2

顯然我有太多的apache poi jar返回太多的方法,並且在嘗試讀取和寫入xlsx文件時超出限制。下面是我得到的錯誤太多的方法錯誤

trouble writing output: Too many methods: 66024; max is 65536. By package: 
    13 java.lang 
    1 java.lang.reflect 
    5 java.util 
    1 javax.xml.namespace 
    66 org.apache.xmlbeans 
    19 org.apache.xmlbeans.impl.values 
    1 org.apache.xmlbeans.impl.xb.xmlschema 
    2500 org.openxmlformats.schemas.drawingml.x2006.chart 
    1430 org.openxmlformats.schemas.drawingml.x2006.chart.impl 
    8767 org.openxmlformats.schemas.drawingml.x2006.main 
    5258 org.openxmlformats.schemas.drawingml.x2006.main.impl 
    86 org.openxmlformats.schemas.drawingml.x2006.picture 
    33 org.openxmlformats.schemas.drawingml.x2006.picture.impl 

有沒有辦法解決這個問題?我不想刪除任何庫,但我的項目不編譯。請幫忙。

回答

1

發現問題!

這是Apache POI與Android的XSSF不兼容!實際上Apache非常好,但是當Android將Java代碼轉換爲Dalvik可執行文件時,它具有65536的方法限制,即處理XSSF時Apache POI的庫超過了該限制。因此錯誤。它與線條無關。 :)我只有75行和7列。關於這方面的更多信息可以在http://mail-archives.apache.org/mod_mbox/poi-dev/201110.mbox/%[email protected].com%3E找到。

0

簡短回答:

只是刪除不必要的jar文件。例如從你給出的列表中,我看到從org.openxmlformats.schemas.drawingml.x2006.main有'8767'方法,如果沒有必要,只要刪除這個jar文件,你的生活會更容易。

詳細的解答:

鈦官方吉拉,這個錯誤仍然「解封」,創建1年前。我不認爲他們明天會發佈一個新版本。 (https://jira.appcelerator.org/browse/TIMOB-18082

刪除不必要的jar文件會導致運行錯誤,但是,因爲它們是不必要的,沒它們出現運行錯誤。

閱讀註釋,也參考這裏:ADT: fail to build when there are too many packages and classes

這裏:Can we create multi dex support builds in Titanium android?