Weird and super simple [bug] that Saved me 30mb in APK size!!!

Hello guys,

I’ve just noticed this weird bug [or a nice feature] when packaging my project.

If this bug is consistent it’s huge news, if not then i guess i got lucky.

before talking about the bug, i would like to note that i only tested it in my project and i didn’t have the time to test in any of the remade project to check if it’s reproducible.

So my APK size is usually around 100mb, and i was trying to test some level streaming into my project, and i added a new map into my project and added it to the list of the maps to be packaged.

i’ve noticed that when i packaged the project with the new map added to the packaged build, my project size decreased by 30mb!!.
Note that: i didn’t use the new map in game and i don’t have any actors in it, it’s only added as a sub-level to my persistent main map in levels window.

to be sure, i made two more packages one with the map included in the package and one without. and to my supprize the APK diffrence was 30mb,
Remember including the unused map reduced the APK size, also i only use 1 level in my whole project.

If i got time, i might do some testing on the pre-made projects later tonight.


Edit: I’ve just tested this on the paper2d project and it did not reduce the APK size, i have to investigate more on my project and i will reply here if i find anything new.

I suspect this just limited the cook to your set of selected maps instead of cooking all; this would mean only referenced assets were included which if you had other unused assets this might have removed them.