Large file sizes for builds, how big is the overhead for Corona?

Forgive me if this is a common question, I swear I searched the forums and this was the closest I could find that related to my question, and it’s over a year old:

http://developer.anscamobile.com/forum/2010/10/29/differences-built-app-file-size-depending-folder-built

Also, there was this link, also making me a little concerned:

http://developer.anscamobile.com/forum/2010/11/06/advice-file-size-iphone-game

I’m assuming that Corona just compiles in all of the classes and resources that are needed for the entire library, regardless of whether or not they are used.

In comparison, the original flash game I ported to Corona, with even more resources (~3 minutes of mp3 audio, more spritesheets) was less than 900kb when compiled with AIR. The Corona port is 4MB, and that’s before additional audio, graphics and code.

Of course, the Flash/AIR runs about half the speed as the Corona port, but I still don’t understand why the files are so huge. [import]uid: 49447 topic_id: 16080 reply_id: 316080[/import]

Hey there,

You are right - that’s quite old. Since then we’ve lost a chunk of size because all the OpenFeint stuff isn’t automatically included unless you specifically require it.

Is the 4MB file the zip?

I have made some fairly large (contest wise) apps in the past and have never (yet) broken 20 MB.

Peach :slight_smile: [import]uid: 52491 topic_id: 16080 reply_id: 59851[/import]

Are corona files (physics for example) bundled automatically during build or does it only build what is required (require = “physics”) ? [import]uid: 79135 topic_id: 16080 reply_id: 59855[/import]

Sorry I realized before I should have clarified that typically users report around 4MB (or a little less) before compression, with the compressed size being what counts on the app store. (As far as aiming to keep it under the 20MB goal.)

I’m not certain about physics, I believe it is only included when required however I am not 100% certain. I will have an ask around later :slight_smile:

Peach [import]uid: 52491 topic_id: 16080 reply_id: 59859[/import]

Not sure what you mean by zip, as I’m building to APK (android). I realize that .app files are basically .zip files, however APKs need to be decompiled and recompiled - not a trivial process.

My actual game is only using 16kb of assets (4 spritesheets) and I’m using physics and sprite libraries. That’s it. The resulting APK is 4.17MB.

On the other hand, the AIR apk file I created (the one with about 3x the assets) is 840KB [import]uid: 49447 topic_id: 16080 reply_id: 59867[/import]

I believe you can rename a apk to zip to open. [import]uid: 79135 topic_id: 16080 reply_id: 59870[/import]

right you are! I didn’t realize that.

Right away, the obvious culprits are:

  • classes.dex - 1.34MB (I’m assuming this is necessary, although it probably includes ALL classes, not just the ones used in the app)

  • com folder - 125KB (944KB size on disk). This one is interesting, it has a single folder tree (com\google\i18n\phonenumbers\data) and inside that data folder, 235 files all starting with “PhoneNumberMetadataProto_” These seem extraneous.

  • in the assets folder, there is a file “com.papaya.socialsdk.corona.171.webpage.db” which is also extraneous, since I’m not using papaya.

There were a few other files that certainly weren’t necessary, like facebook icons and etc. but the size of those was negligible.

I was actually able to remove the entire com/google/… folder and all 235 files, and I also removed the papaya file. Then, I re-zipped the files back into an APK. Cut the file size in half, from 4MB to 2MB.

I’m sure with a little more poking around I could optimize it even further, although it seems perhaps Corona should know which libraries to include or not. [import]uid: 49447 topic_id: 16080 reply_id: 59871[/import]

It would be good if Corona’s build process could exclude all the unnecessary files. [import]uid: 12448 topic_id: 16080 reply_id: 59881[/import]