Apk size is too large

Hi , I am new to react native , I made simple app with around 10 js files, whose size are around 100kb only , but when I create apk via expo:build:android , file size is around 25Mb , What is the reason ? If I eject it and build apk via android studio , will the apk be small size ?

Some one tell me how to create app with very small size , I need it in less than 5 mb.

1 Like

In order to enable you to update your experience without resubmitting you app to the stores, your apk / ipa need to contain the native code to run anything in our SDK. If you detach, you’ll be able to reduce the size of your binary, but you’ll need to identify and remove the things you don’t need.

Hello @thetc,

i have created an app from which was 25mb and i detached it and now it is 30mb.
can you please tell me or give me a reference or link like, what should i keep in my apk and remove from it to reduce the size… help needed!

any suggestions or advice, please let me know!

Hi!
From Expo’s docs:

“If you need to keep your app size extremely lean, Expo may not be the best choice. The size for an Expo app on iOS is approximately 33mb (download), and Android is about 20mb. This is because Expo includes a bunch of APIs regardless of whether or not you are using them – this lets you push over the air updates to use new APIs, but comes at the cost of binary size. We will make this customizable in the future, so you can trim down the size of your binaries.”

https://docs.expo.io/versions/v28.0.0/introduction/why-not-expo#if-you-need-to-keep-your-app

1 Like

Hello @atiladev thanks mate for your reply,
I got the main reason behind the size of apk.
But i have a seen some people around on expo that they reduced their apks or ipas size to minimum of 8 to 10 mb.
Can you please tell me how to do that, i know i have to remove some of the libraries and modules from my project.
How will i know that which should i remove and which should i keep?
And thanks again for your efforts!

1 Like

Hi @akhil_007 - I think the most likely thing is that the people with 8-10 mb APKs are using plain react native without Expo. As others have noted, somewhat larger APK sizes are simply a fact of life when using Expo currently – we have plans to improve this but they simply have not materialized yet. If APK size is important to you it may be best to just not use Expo for now.

2 Likes

Regarding what you say about reducing the size using Expo, I have been told, I have not tried it myself) that if you do the Expo, and you compile everything using xcode and android studio, the file weighs a little less, which it is not the least. But this I reiterate, I have been told, I have not had the need to prove it by myself.

thanks @atiladev & @esamelson, i got that and again thanks for your efforts