Question: Apparently I have too many apache poi jars which return too many methods and go above the limit when I try to read and write an xlsx file. Below is the error I get

```
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

```

Is there a way around this? I don't want to delete any libraries and yet my project is not compiling. Please help.

Answer: 
Found the issue!

It's Apache POI's XSSF incompatibility with Android! Actually Apache is pretty okay but when Android converts your Java code into Dalvik Executable files it has a method limit of 65536 which the libraries of Apache POI when they handle XSSF exceed. Hence the error. It has nothing to do with lines. :) I had only 75 rows and 7 columns. More information on this can be found at <http://mail-archives.apache.org/mod_mbox/poi-dev/201110.mbox/%3CCA+JOeWNWinmNmEtHs5VK+KEc_6BzAG_=LfpdXqsDsnjJKR2X7Q@mail.gmail.com%3E>.
short answer: 

just remove the unnecessary jar files. e.g. from the list you gave, I saw there are '8767' methods from `org.openxmlformats.schemas.drawingml.x2006.main` , if it's not necessary, just remove this jar file and you life will be easier.

Detailed answer: 

On titanium official Jira , this bug is still "reopened", created 1 year ago. I don't think they are releasing a new version tomorrow. ( <https://jira.appcelerator.org/browse/TIMOB-18082> ) 

Removing the unnecessary jar files will cause the runtime error, however, since they are unnecessary, runtime error won't occur without them. 

read the comments, also refer to here: [ADT: fail to build when there are too many packages and classes](https://stackoverflow.com/questions/11380179/adt-fail-to-build-when-there-are-too-many-packages-and-classes)

and here: [Can we create multi dex support builds in Titanium android?](https://stackoverflow.com/questions/27169053/can-we-create-multi-dex-support-builds-in-titanium-android/34961419#34961419)