I am developing a small dictionary app by using react native with expo.
As I am compiling to Apk file. The size goes up to 30mb and after having installed on a devi
I used all above steps for reducing my app size. Now it's 6.94 MB. How to reduce it even more. Similar apps are less than 1 MB on Google Play.
the other way to reduce your app size without manually copy-paste your code in another repo. In app.json or app.config.js just set it enableDangerousExperimentalLeanBuilds
to true
, by doing this expo won't install the unnecessary node modules when you are running expo build:android -t app-bundle
.
If you run into any crashes compare the native node modules which are installed before enabling enableDangerousExperimentalLeanBuilds
and install only the required one. You can find the native node modules installed in the expo.io
build artefacts.
here are some node module that come along with managed flow which you may not require
expo-ads-admob:8.3.0 expo-analytics-amplitude:8.3.1 expo-ads-facebook:8.4.0 expo-analytics-segment:9.0.0 unimodules-constants-interface:5.3.0 expo-app-auth:9.2.0 expo-apple-authentication:2.2.1 unimodules-app-loader:1.3.0 unimodules-font-interface:5.3.0 unimodules-image-loader-interface:5.3.0 unimodules-permissions-interface:5.3.0 expo-application:2.3.0 expo-av:8.6.0 expo-background-fetch:8.5.0 expo-task-manager:8.5.0 unimodules-task-manager-interface:5.3.0 expo-barcode-scanner:9.0.0 unimodules-barcode-scanner-interface:5.3.0 expo-battery:3.0.0 expo-blur:8.2.0 expo-brightness:8.3.0 expo-calendar:8.5.0 expo-camera:9.0.0 unimodules-camera-interface:5.3.0 unimodules-face-detector-interface:5.3.0 unimodules-file-system-interface:5.3.0 expo-cellular:2.3.0 expo-constants:9.2.0 expo-contacts:8.5.0 expo-crypto:8.3.0 expo-device:2.3.0 expo-document-picker:8.4.0 expo-error-recovery:1.3.0 expo-face-detector:8.3.0 expo-facebook:9.0.0 expo-file-system:9.2.0 expo-firebase-analytics:2.5.0 expo-firebase-core:1.2.0 expo-font:8.3.0 expo-gl:9.1.1 expo-gl-cpp:9.1.2 expo-gl-cpp-legacy:8.4.0 expo-google-sign-in:8.3.0 expo-haptics:8.3.0 expo-image-loader:1.2.0 expo-image-manipulator:8.3.0 expo-image-picker:9.1.1 expo-permissions:9.3.0 expo-in-app-purchases:9.0.0 expo-intent-launcher:8.3.0 expo-keep-awake:8.3.0 expo-linear-gradient:8.3.0 expo-local-authentication:9.3.0 expo-localization:9.0.0 expo-location:9.0.0 expo-mail-composer:8.4.0 expo-media-library:9.2.1 expo-module-template:8.4.0 expo-network:2.3.0 expo-notifications:0.7.2 expo-payments-stripe:8.3.0 expo-print:9.1.0 expo-screen-capture:1.1.1 expo-screen-orientation:2.0.0 expo-secure-store:9.2.0 expo-sensors:9.1.0 unimodules-sensors-interface:5.3.0 expo-sharing:8.4.1 expo-sms:8.3.1 expo-speech:8.4.0 expo-splash-screen:0.6.2 expo-sqlite:8.4.0 expo-store-review:2.2.0 expo-updates:0.3.3 expo-video-thumbnails:4.3.0 expo-web-browser:8.5.0
For android APK bundle using expo, you can use the following command:
expo build:android -t app-bundle
The size will be much smaller once you upload it to the play store. This is relevant for React Native SDK 32 and earlier.