I get this error: Data exceeds UNCOMPRESS_DATA_MAX on android 2.2 but not on 2.3

I too have a similar problem and after much searching, I found this page to answer my question.

http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/

In summary, Android compresses any asset file except the ones that are list on the page, since they are already compressed. This compressing is generally a good thing, but it comes back to haunt programmers when a file is too big. The two options that the author suggests are to 1)rename the database file to be one the doesn’t get compressed (such as .jpg) or 2) turn off compression for the database’s file extension (see the blog post on how to do that). Number 2 can be difficult though if you are using Eclipse so the author recommends using the first option.

This whole problem was corrected in Android 2.3.3 which is why you don’t have the error appear 🙂

EDIT: This site explains it really simply:
https://web.archive.org/web/20120423232710/http://www.nutprof.com/2010/12/data-exceeds-uncompressdatamax.html

EDIT 2: Looking back on this answer, I realize that depending on the size of your file, perhaps you could consider downloading the file from a web server and then copying it to wherever you need it to go. In my case, I was copying a SQLLite DB to the app private storage, but since the APK is signed, I couldn’t get rid of the old database from my assests. So now instead of all that funky naming stuff, I just went and had it download it from the internet on the first run and put it in the private space. That way the application doesn’t double its size on first run.

Leave a Comment