Home > Enterprise >  facebook or Uber react native app size is so small
facebook or Uber react native app size is so small

Time:02-17

I was trying to a react native application which just take a phone number and have country codes. This app is of size 60mb. Whereas large apks such as facebook and uber which are also build on react native are of around 100 mb.

How is this possible?

I have even tried this also.

 Open up android/app/build.gradle
Set def enableProguardInReleaseBuilds = true this would enable Progaurd to compress the Java Bytecode. This reduces the app size by a tad bit
Set def enableSeparateBuildPerCPUArchitecture = true . Android devices support two major device artitectures armebi and x86. By default RN builds the native librariers for both these artitectures into the same apk.

CodePudding user response:

You have to optimise your app size. There are some approaches through which you can optimise the size of your app

- Remove unused libraries from `package.json`
- Remove unused `imports` from all the files in the app.
- Remove unused assets including Audio, Video and Images files
- Resize the images which are using in the app.
- Using Hermes, is an open-source JavaScript engine optimized for React Native. 
  For many apps, enabling Hermes will result in improved start-up time,
  decreased memory usage, and smaller app size.

More details Hermes

CodePudding user response:

beside all issues @Nooruddin-Lakhani mentioned above this can also help :

also keep in mind Generate release as Bundle will help you!

  • Related