Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is APK created using React Native and expo so large in size?

I created two versions of the same mobile app using two diffrent technologies. React Native + Expo and React + Capacitor.

What caught my eye is that the difference in the size of APK packages is quite big. So I tried creating a Hello World app with React Native + Expo and even that app was quite large in size. What exactly causes even simple apps created by React Native to be so large?

like image 431
m_novak Avatar asked Sep 11 '25 22:09

m_novak


1 Answers

React native has a lot of boilerplate code which it needs for creating a bridge between react native and native. and along with that it has node modules other dependencies which increase the APK size.

Basically app sizes can depend on :

  1. JS code (eg your written code in js, nodemodule codes written in js)
  2. Native code( Since RN communicates with the native side, it creates a bridge and hence more boilerplate code is added by default for that to happen)
  3. Assets(eg images , videos ) those can hamper size, hence its always better to have remote URLS.

One suggestion would be creating an AAB file, and then uploading to playstore since that decreases size by quite a significant amount.

You can also check this thread RN-reducesuze

Do let me know in case of any doubts

like image 101
Gaurav Roy Avatar answered Sep 13 '25 11:09

Gaurav Roy