Decrease the android apk size as much as possible

Hi , im building a simple 3D game with like 10 cubes in total and some physics. and this is an experiment to Try to decrease the size of the APK. I know this have been asked before but there is no good sollution So i want this to be a refrence from game developpers who want to decrease the apk size and remove all unnecessary packages

those 2 folders are the important one in terms of size
so i went to assets\bin\Data\Managed aand i found unnecessary DLLs like networking 2D phycis etc…
so i disabled the packages

However after disabling most of the packages i still GET THEm In build

and the size didnt decrease significantly : like 60 Kb …

So how to prevent them from building in the game because SIze is important in android devices.
and more importantly " How to decrease the size of the apk To the maximum?

Removing a few packages is not going to really decrease your build size much honestly. If your project is packed with assets, that is where I would focus your attention. Compressions and looking into assetbundles and such is going to have the biggest impact.

Yeah, what @Brathnann said above: code is rarely your tall tent-pole. It’s almost always textures, followed by audio, usually in that order for most projects, but YMMV. Move those big items to an AssetBundle (or Addressible) and you may get meaningful improvement.

Instead of speculatively removing DLLs, I recommend doing some actual engineering and making a blank project APK, then unzipping the APK contents alongside of your game’s APK unzipped, and seeing what is different.

I also don’t recommend removing random bits of Unity DLL. I imagine if that were truly without peril, Unity would already offer that. Unity is by the way moving in the direction of more modular solutions, but they have a ways to go still.

Using the right resolution, and type of Textures can save so much space. Make sure the height, and width of the Textures are multiples of 4 so the ETC compressions kicks in too.

Thank you for your answer , well The game is not packed with any assets, i just used built-in unity cubes and colors (no textures, no 3d models, no audio etc…) see the video if you want https://www.youtube.com/watch?v=pAWx5ltO9uU . SO I dont think that the assets are the problem and i will take a look at aassetbundles :smile:
But i think having unneccesary dll (size between 300-100 kb ) is pointless it could decrease the size by at least 1mb.

yes you are right but as i said to @branthnann This is a testing project the file it has no AUDIO, no Textures, No imported assets from blender or anything, only materials from unity that contain color (i dont know if that s heavy ).
And i agree with you, removing dlls manually is not good. it can ruin the game.
Then i made an empty scene and look at it s size it s not significant:

Only 200 kb decreased so 17.109 For an empty scene and then i made build with l2cpp


if i add anything else i cant even use google play instant for exemple (which requires a build under 10mb ) …

Okay thanks this is noted for futur projects :smile:

I don’t think you understand, we know your example has barely anything in it. We were just directing you to where your savings will come from. But honestly, 1mb is nothing and if you’re worried about that, you’re focusing on the wrong thing.

If you want to build Instant apps, you probably want to export your game and run it through Android studios or look into project Tiny as it gets further developed. (I think Tiny is 2D only right now, but 3D is coming)

Thank you this is really helpful for futur projects packed with textures and stuff and for the project tiny this is what i was looking for that s really good :smile:

By the way for everyone who still looking for approach to reduce size of build:
Addressables is so useful for managing assets (upload remotely and cache).
Unity Manual
Tutorial (textual)
Tutorial (video)

Preventinh bumping by spammers.
Make a new thread linking here if you want to add to it.