Optimize React Native App Size: two steps

Raj Prajapat
1 min readJan 18, 2021

Hello Friends,

Today I’m showing you the two easiest steps to optimize your react native app build with expo or without expo.

STEP 1:

if you are not using expo skip Step 1

a) Create a new folder.

b) run command

react-native init appname

if the above command not work https://stackoverflow.com/questions/37189081/react-native-command-not-found

c) Put/Copy your src folder & App.js in these new folder make sure you update package.json dependencies.

d) run command:

npm i or yarn install

STEP 2:

open file #android\app\build.gradle

Change

def enableSeparateBuildPerCPUArchitecture = true

by making this true you create two separate APKs instead of one:

* - An APK that only works on ARM devices

* - An APK that only works on x86 devices

&

def enableProguardInReleaseBuilds = true

by making this true it will Run Proguard to shrink the Java bytecode in release builds.

Done!!

--

--