Apk size

hello defold team

A little game i was working on went from a 5.7 mb apk file to a 16.6 mb apk file … what did i break NOW??
Only change was that i updated to the latest build 1.2.174, was THAT it?

sorry for getting on every bodies nerves again but if i don’t ask i will stay stupid :slight_smile:

1 Like

When you bundle from the editor you have the option of generating a html file report. Try doing that and see if anything stand out for you. Are you using any dependencies which might have increased their sizes?

The engine size doesn’t look like it should be increased in this version for Android.

I tested making an Android bundle now for 174 with a blank project and the final APK is 3.53 MB. Looking inside the largest files are the .so files for arm64-v8a and armeabi-v7a. I believe in the current Android system you upload an APK like this to Google but it only delivers the file necessary for the user to run on their device? So that means your user will only download 1 appropriate set.

Check the lib folder of your apk, remember it’s a zip so anything that can open zips like 7zip can open it. This will show you which files are largest in the apk. If you compare that with 173 or whichever version you were on before it can give a clue where the size increased.

nothing appears “big” … biggest file is /builtins/input/default.gamepadsc with 53 kb, fontc (56k) and luac (96k) use the most in the pie chart

using colyseus 0.13.4 with dependencies and hypertrails …

the lib folders contain the lib(gamename).so’s … 24.3 and 23.5 mb

it has to be colyseus or one of the deps, mobile game template makes a 3.8 mb apk before and a 16.5 mb after adding colyseus … but even if i use previous versions … and as i said earlier, the little game went from 5.7 mb to 16.5 mb too

thanks for the help @Pkeod i think i should check on github for what changed in the deps i am using, a 11 mb difference seems just too big, no?

1 Like

Again in this case it may just be the additional .so that’s making the total bigger, and again it may not be something to worry about since only one version should be shipped to the user on Google Play. Others can confirm for sure if the new Android bundle process is live in this version and is the cause for this.

the installed version on the phone is almost 39 megs now too …it used to install with less than 10 … that was what fascinated me, networking and everything working with such little size

Are you installing it directly or through Google Play? Google Play is where the selective processing to make the final installer smaller should be taking place.

i bundle it on my laptop, transfer it via usb and install from the android file manager,always debug release

In this case then it will be this large (larger than final user gets through Google Play), you need to test installing it through Google Play to see its real size that the user will get approximately since it’s based on their hardware on what they get.

i always installed like described, i don’t have a google play account … that’s why it got my attention, because i didn’t change anything

Do you remember the last Defold version you had installed? It would still be worth testing more and confirming. Others can confirm too when they are around.

the previous version for linux 1.2.173 … let’s wait and see what others say … this is interesting

Those sizes (~23mb) is usual for android’s unstripped libraries.
When stripped, they’re more in line with the sizes @pkeod linked to (dmengine_size)

I’m confused, did you bundle the apk using “release” variant?
The engine gets stripped from debug symbols when using release mode.

1 Like

i never used “release” variant since i started using defold actually.

i always used the same settings when creating the .apk … and from one day to another the size almost tripled, the only change i did was to check the checkbox to create the build report as @Pkeod suggested. this “issue” got my attention because the build takes a LOT longer now and when i sent the .apk to my phone, i saw the size difference in the dialogue to confirm overwriting the old.apk on my phone … old file:5.7mb new file:16.5mb

Pls, share the old apk(“before”) and the new apk(“now”) here on forum, as well as report files for both builds, and we will check what’s going on together.

wow, i guess THAT is impossible … not that i don’t want to share (it will be a “tutorial” hopefully soon) but rather because the old apk is overwritten when i re-bundle to test it on the android device.

can i revert to the older version of defold somehow? on d.defold.com i find the version but no download link so i could just unzip it and re-bundle from there …

1.2.173 Mac

1.2.173 Win

1.2.173 Linux

Let me know if you need another version

let me try 1.2.172 linux … .173 gave same result

1.2.172 Linux

1.2.171 Linux

Pls share a current APK and the build report for the APK (if you can’t in public, you can share in PM)

hope this got attached … edit: nop, maybe 16.6mb is too big?

edit2: could this possibly have anything to do with openjdk upgrade?