Is the minimum APK size of an Android app made by Unity 8MB? I am building an empty project, but still getting 8MB. Is there a way to reduce the APK size?
For reducing APK size:
In Unity 5.6.0f3 I have created a simple "Hello world" program and build an APK file, it consumes 21.2 MB at first but to reduce the size you have to follow these steps:
Unity 5.6.0f3: Player settings > other settings > optimization > API compatibility level
Unity 2018.3.6f1: Player Settings > Other Settings > Configuration > API Compatibility Level
.NET 2.0 Subset.
To avoid memory wastage, Unity also supports the .NET 2.0 Subset API profile. This is very similar to the Mono "MonoTouch" profile, so many limitations of the "MonoTouch" profile also apply to Unity's .NET 2.0 Subset profile.Unity's .NET 2.0 Subset profile.
Unity 5.6.0f3: Player settings > other settings > device filter > ARMv7
Unity 2018.3.6f1: Player Settings > Other Settings > Configuration > Target Architectures
ARM and x86 are both processor architectures. x86 belongs to Intel while ARM is used by different companies and widely used, so no need to select both architectures.
Unity 5.6.0f3: Player settings > other settings > rendering path > Legacy Vertex
Unity 5.6.0f3: Player settings > other settings > Optimization > Stripping level > Use micro mscorlib
The Lightweight mscorlib version will be used at expense of limited compatibility.
Most games do not use all the functionality of the provided DLLs. With this option, you can strip out unused parts to reduce the size of the built player on Android devices.
After applying all these changes it becomes 10.4 MB.
For reducing IPA size:
In Xcode, there are few flags you need to set,
Build Settings-> Enable Objective-C Exception-Yes
Build Settings-> Enable BitCode-No
Build Settings-> Compress PNG files -No
In Player settings, Device Filter, Select ARMv7 only
(In latest unity (2018.1), this can be found as Other Settings, Target Architecture)
Also scroll down, set Stripping level to Use Micro mscorlib
These should reduce the size a bit further
Even though your project doesn't contain any of your code yet, it still contains the Unity libraries and they are a fixed size. 8MB
is very small for any Android app, let alone a game. I wouldn't worry about that until later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With