Build size. Auto Stripping or manual configuration


#41

The really cool thing about Native Extensions is what it promises to do with build size in future builds. Our plan is to make Bullet, Box2d and Facebook into public extensions that can be excluded if they’re not used by your game. This will have a significant impact on build size and it’s going to be really exciting to see how low we can go!


#42

Dreams comes true :upside_down:
And then we will able to mark this topic as solved =)

UPD: topic updated with Defold 1.2.100 data
UPD_1: topic updated with Defold 1.2.102 data
UPD_2: topic updated with Defold 1.2.112 data


#43

Is there an ETA on the auto stripping or similar implementation?


#44

it’s already done! You can remove unused modules using App Manifest
More info here


Or here (rus):
http://agulev.com/defold-umenshaem-razmer-bilda-app-manifest/


#45

Did you see last changes on Google Play?
Looks like Google consider build size one of the most important info about an app.


#46

I’ve made the new release .apk today and noticed that build size rised by a Megabyte from my last .apk. There are no new resources, app manifest, etc, the same project with small texts changing.

See on screenshot:

Hmm ???


Huge size of android build (SOLVED)
#47

It seems that it happened in version 1.2.136

Maybe something of these changes:


#48

Yes, unfortunately, in order to be backwards compatible, we needed to update the java packages. And since google stopped supporting a ready made android-support-v4.jar, we had to create one ourselves.
It’s a tedious process, and we’d very much like to get back to it and perhaps use Proguard (if that helps in this scenario) to remove redundant classes.


#49

I have read this article https://developer.android.com/topic/performance/reduce-apk-size
and what I wanna ask:
As I understand Defold adds to apk the Facebook resources (res folder) even if we turn off facebook using appmanifest. How to avoid this? (I understand that it’s something about100Kb but I wanna back my solitair in 3Mb :))) )


#50

As you mention, currently there’s no easy way of removing those assets. Even google play assets are there, which might conflict if you’re using newer google play libraries.

What we’d like to do, is to build upon the app manifest, to remove (or rather hide) the cumbersom configuration part, and instead specify what features you’d like to include or exclude. E.g. you should be able to uncheck a box next to the Facebook feature, and our tools would take care of the rest.

We’re not quite there yet though, so in the meantime, I wonder if the easiest way would be to unpack the .apk, remove those assets and then repack it again?
(I’d really like us to support custom scripts in when bundling from the editor, so you could automate those steps)


#51

@AGulev do you have an updated minimum size on HTML5? It should be around 1MB now, right?


#52

I have no updates for empty project, but for Solitaire game:
asmjs: 4.1 Mb and gzip 1.3
wasm: 2.6 Mb and gzip 1.1


#53

Did you done some Android Build tests ? Are the build sizes bigger or smaller in comparison to the previous DEFOLD version ?


#54

there is a size comparasion here https://github.com/britzl/dmengine_size that @britzl keeps up to date :slight_smile:


#55

It’s hard to compare old versions with new one, because now we have appmanifest and webasm for html5 builds, but let’s try:

Defold 1.2.144 (without appmanifest) :

  • ios 5.0 Mb
  • android 4.0 Mb
  • html5 asmjs 4.4 Mb gziped: 1.1Mb
  • html5 wasm 2.4 Mb gziped: 889Kb

Looks like new builds even smaller than old one except for Android (why)