React Native - Tips para reducir el tamaño del apk
https://medium.com/@aswinmohanme/how-i-reduced-the-size-of-my-react-native-app-by-86-27be72bba640
Reducing size of React Native App (Android)
This is what you have been waiting for, I know.
- 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 artitecturesarmebi
andx86
. By default RN builds the native librariers for both these artitectures into the same apk.
Setting the last function creates two distinct apk in the build folder. You have to upload both of this apk to Play Store and Google would take care of distributing the app to the correct architectures.
Using this split generates version numbers for both apks in the order of 104856 and such. This is auto-generated by the build to avoid version conflicts, so don’t freak out (I did).
This split reduced the apk size from around 7MB to 3.5MB for arm
and 5MB for x86
respectively.
No Comments