[Mono-bugs] [Bug 662228] New: Provide a way to leave assets uncompressed

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Jan 4 07:00:02 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=662228

https://bugzilla.novell.com/show_bug.cgi?id=662228#c0


           Summary: Provide a way to leave assets uncompressed
    Classification: Mono
           Product: MonoDroid
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Tools
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: Benjamin at exDream.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Description of Problem:
We have many asset files (textures, 3d models) bigger than 1MB and this causes
the AssetManager to report "Data exceeds UNCOMPRESS_DATA_MAX" and then a Java
IO Exception is thrown. See below for details.

Steps to reproduce the problem:
1. Put any file above 1MB into the Assets folder (or resources or anything that
gets into the .apk file).
2. Try to load it via the AssetManager

Actual Results:
Crashes with Java IO Exception

Expected Results:
Well, just provide a way to set Assets to uncompressed, then this issue goes
away or provide a way to customize the aapt command (see below)

How often does this happen? 
Always.

Additional Information:
By default all assets (and resources and everything else) in the
apk file are compressed (deflate flag for the zip file that the .apk
is). All files above 1MB that the AssetManager of Android tries to
read will fail with a message like "Data exceeds UNCOMPRESS_DATA_MAX
(3145856 vs 1048576)".

Now there is an easy fix, by using -0 "filename" or -0 "" for all
files for the aapt command (android assert packaging tool). Then files
are 4 byte aligned and stored uncompressed (store flag in the zip
file). Now all AssertManager reads magically work. This is what I currently do
with a custom tool of mine that just repackages the .apk file (works fine with
the shared runtime version, but strangely breaks the non-shared runtime .apk
file, dunno why). It would of course be better if MonoDroid would have an
option to use uncompressed assets directly for packaging .apk files.

In the past we also used the sdcard and loaded files from there (much better
approach for big applications anyway), but that seems to be broken too right
now (we have not really tried it for a while, but all attempts crashed so far
with some Java Exception).

Here are some links about the issue.
http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/
http://stackoverflow.com/questions/2278359/android-how-to-make-game-asset-files-readable-from-c-code-using-ndk
http://stackoverflow.com/questions/3034615/android-assets-no-value-read

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list