2013-08-18 49 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?