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

Time:06-07

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?

CodePudding user response:

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

  • Related