How to Reduce your Android release App size, up to 47% or even more — React Native

Kyle Buntin
2 min readSep 29, 2021

After finished developing and building your app, you then realise that it is somewhat bigger than what you prefer. The first thought that comes to your mind is “how can this be reduced?”.
Consider using Hermes to achieve this. In one of our apps at Quick Component, we experienced about 19.2 percent decrease in app size when building release with Hermes. See the image below.

Without Hermes

With Hermes

Also checkout another app where about 47% decrease in app size was experienced using Hermes.

How do we build with Hermes? You only need to edit one or two files.

In android/app/build.gradle enable Hermes

project.ext.react = [     
entryFile: "index.js",
enableHermes: true // clean and rebuild if changing
]

Also, if you’re using ProGuard, you will need to add this rule in proguard-rules.pro :

-keep class com.facebook.hermes.unicode.** { *; }

Next, if you’ve already built your app at least once, clean the build:

$ cd android && ./gradlew clean

And now you can build ur release as you would normally do with

./gradlew bundleRelease

Also note that There are other benefits to using Hermes like stated here: Hermes is an open-source JavaScript engine optimized for running React Native apps on Android. For many apps, enabling Hermes will result in improved start-up time, decreased memory usage, and smaller app size.

Also, ensure you’re using at least version 0.60.4 of React Native.

You should checkout QuickComponent for a premium react native templates with backend. You find the React Native WhatsApp Clone(with audio and video calling) and more React native apps like, Dating app, UberEats clone, and more with complete video calling feature and stripe payment.

--

--