- Home /
How to reduce size of android apk
Hi, I recently started learning Unity and completed a small 2D mobile game for android. I see the game size(apk file)as 10MB , but my game hardly contains 2 small textures
When i checked the apk, I saw following files are taking the large amount of space Can you please suggest, Is there is a way to reduce the size of apk file?
Is it trade of for multiplatform support?
libunity.so :- 10MB
libmono.so :- 3.5MB
mscorlib.dll : - 2.5MB
system.dll :- 1MB
Answer by Mmmpies · Dec 03, 2014 at 08:37 PM
Far from an expert on this but Unity has to be able to operate for a vast amount of different games. Yes 10MB is big in the context of a small test game but I'd put money on the fact that in modern day terms 10MB for library files that handle a whole heap of stuff is pretty normal.
Yes your game probably doesn't need all of that but we live in an age where 100+ Gb micro SD card are available so 10Mb is 0.001 % or less.
Is there a reason, other than trying to be efficient as possible, that you need a tiny file?
Unless there's a specific reason (e.g. medical app that needs to be downloaded in remote areas with only modem speed connections) I wouldn't worry too much.
Answer by screenname_taken · Dec 03, 2014 at 08:47 PM
Those 8 megs are the engine. Don't forget that the engine is a full 3d fledged one. Unity Pro has a feature that can strip away all the parts that aren't needed in the build to reduce the size a bit.
Hey, Like you mentioned Unity PRO can Strip engines. I agree but can you tell me how much difference does it make? Like 10$$anonymous$$B game can be stripped to how much $$anonymous$$B's ?
Nothing much more. If you are using Unity 5, then you have all the stripping power of Pro even if you are using personal edition. They are the same now in that regard.
Hmm but $$anonymous$$y Export size of AP$$anonymous$$ is more in Unity5 Ins$$anonymous$$d of Unity4.6.2.. Is there any tutorial link that how to use only required libraries ?
Answer by sz-Bit-Barons · Dec 04, 2014 at 12:15 AM
I think there is no way currently to reduce the file size by hand without breaking something...
However, I heard with unity 5 they make the engine module based. So if you don't need a certain part of the engine (e.g. physics) it is not included in the final build.
Unity 4.x also does something similar, but that is not in the Free version. So we don't know if that will be included in the Free of 5 as well.
Answer by rainbowgamesltd · Dec 04, 2014 at 07:52 AM
Thanks to all for replies.
I got that 10MB is very small when compared to the PC games. but it is more for the Medium sized 2D mobile games where most of the games are below 50MB
since Unity is supporting 3D and cross platform, they might have worked hard to put the engines in 10MB. thanks for your hardwork.
It will be very great if the engine is modularised in next version. Hobby developers like me will benefit a lot.
I will try to make good big game so that 10MB is insignificant. :) :)
Answer by $$anonymous$$ · May 26, 2016 at 06:36 PM
A very effective way would just be to cut down on detail, and also make sure to compress your audio and images. Quality won't be as good, but it'll really cut down on the APK size. There is a site to compress .PNG images down to under half of what they were, and you can just use built-in Unity methods to compress even further... if you have retro-themed sprites, you could probably compress those down multiple times, and turn off the Unity sprite filters, and it'll look perfectly retro. :)