Build size. Auto Stripping or manual configuration

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.


I have read this article
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 :))) )

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)


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

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


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

there is a size comparasion here that @britzl keeps up to date :slight_smile:


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)


In the new update of Google Play Console they pay even more attention to the build size:

  • App size metrics and reports — gain insights about your app size in Android vitals, including download size, size on device (at install time), changes compared to peers over time, and tailored optimization recommendations.


.apk size for 32bit only and 32+64bit architecture in the release mode:
And of course it’s still possible to upload two different apk:


Does Defold have any plans to use App Bundles?


No, nothing concrete no.



@AGulev, will you update the sheet with data for 1.2.170? I’m curious how it is now with Android App Bundle :thinking: also what exactly do you measure? Size of the the whole folder? For both Defold and Unity the same approach?


Thanks @selimanac! :wink: Is there something like this for other engines? I found one for Godot:

1 Like

Yes, I tested in similar conditions, ofc.

New tests with empty projects.

Unity version 2019.4.0f1
Defold 1.2.170
Pls check projects to make sure I removed everything I could.
In Unity, I use Stripping Level High which is pretty dangerous and often breaks bundle. In Defold I did two builds, one without AppManifest at all, and another one with manifest that cuts off Physics modules and Record module.


AAB size is not the same count of megabytes that will be delivered to the end-user. Pls, check apk sizes - it’s closer to size end-user will download.

Unity build Android AAB (32 and 64 bit) - 11 Mb
Defold Build Android AAB (32 and 64 bit) - 3.3Mb
Defold with AppManifest Build Android AAB (32 and 64 bit) - 2.7Mb

Unity Android apk 32 bit - 5.7 Mb
Defold Android apk 32 bit - 1.6 Mb
Defold with AppManifest Android apk 32 bit - 1.3 Mb

Unity Android apk 64 bit - 6.1 Mb
Defold Android apk 64 bit - 1.6 Mb
Defold with AppManifest Android apk 64 bit - 1.4 Mb

HTML5 (wasm only)

Folder: 2.8 Mb
GZIP: 2.7 Mb

Folder: 2.3 Mb
GZIP: 881 Kb

Defold with AppManifest
Folder: 1.9 Mb
GZIP: 734 Kb


Unity universal build ipa - 9.8 Mb
Defold universal build ipa - 2.6Mb

Unity universal build app - 30 Mb
Defold universal build app - 4.9 Mb


Defold Project: (2.9 KB)

Unity project: (21.3 KB)

Raw data

% tree --du -h                                                                
├── [ 17M]  DEFOLD
│   ├── [1.6M]  32.apk
│   ├── [3.3M]  32_64.aab
│   ├── [1.6M]  64.apk
│   ├── [2.3M]  HTML5
│   ├── [881K]  HTML5.tar.gz
│   ├── [4.9M]
│   └── [2.6M]  universal.ipa
├── [ 71M]  UNITY
│   ├── [5.7M]  32.apk
│   ├── [ 11M]  32_64.aab
│   ├── [6.1M]  64.apk
│   ├── [2.8M]  HTML5
│   ├── [2.7M]  HTML5.tar.gz
│   ├── [ 30M]
│   └── [9.8M]  universal.ipa
└── [ 13M]  Defold-with-appmanifest
    ├── [1.3M]  32.apk
    ├── [2.7M]  32_64.aab
    ├── [1.4M]  64.apk
    ├── [1.9M]  HTML5
    ├── [734K]  HTML5.tar.gz
    ├── [4.3M]
    └── [2.2M]  universal.ipa

I added measurements for Defold with the following AppManifest:


Thank you for the update @AGulev! Defold is still way ahead of the competition with regard to size!


I added measurements for Defold with AppManifest (see settings above)

Also, I asked guys from Corona chat (I didn’t check sizes myself):
Solar2D 2020.3600 (ex Corona 2D engine)
6 Mb - apk/aab (32 and 64 bit)
3.6 Mb - html
5.6 Mb - app
2.5 Mb - ipa


Delivering productivity to more users with a smaller app size. By using Android App Bundles, @adobedevs was able to reduce Acrobat Reader’s app size by 20% and has since seen their install conversion rate improve by 5%. Learn how →