Hi I am using managed workflow. How do I remove dependencies that expo adds on time of building the app, When I decompiled apk, I saw many packages that I really don’t use like BioMetric, ads (facebook/google) and many more.
Expo Diagnostics -
Expo CLI 3.22.3 environment info:
System:
OS: Linux 4.15 Ubuntu 20.04 LTS (Focal Fossa)
Shell: 5.0.16 - /bin/bash
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
Yarn: 1.22.4 - /usr/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
npmPackages:
@expo /webpack-config: ^0.12.16 => 0.12.20
expo: ^38.0.0 => 38.0.8
react: 16.11.0 => 16.11.0
react-dom: 16.11.0 => 16.11.0
react-native: https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz => 0.62.2
react-native-web: ~0.11.7 => 0.11.7
1 Like
wodin
July 19, 2020, 9:50pm
2
Hi
That is one of the downsides of using the managed workflow.
There is experimental support for removing some dependencies on Android. See here:
# App size in the managed workflow
Using `expo build:[ios|android]` to build your managed apps can result in 15mb to 20mb base install sizes. To understand why this is the case, please refer to [this post](https://blog.expo.dev/expo-managed-workflow-in-2021-5b887bbf7dbb), which explains how the build process works. Long story short, the entire Expo SDK is included in your build.
The primary benefit of including the entire Expo SDK is that you can confidently update your app over-the-air and know that the JavaScript bits will be compatible with the native bits, because the native bits are all the same for a given SDK version. You can add a capability to your app such as using the camera where you had not before and do so safely with an over-the-air update.
## Use EAS Build instead of `expo build` for smaller app sizes
If app size is more important to you than easier over-the-air-updates, you may want to consider using [EAS Build](https://docs.expo.dev/build/introduction/) instead. You can still use over-the-air updates in your apps built with EAS Build, you just need to [be a bit more careful](https://docs.expo.dev/build/updates/). As of April, 2021, you can build your managed apps with EAS Build to get up to a 10x reduction in download and install size. [Learn more in this post](https://blog.expo.dev/eas-build-april-preview-update-ebd7dff9dd25), and refer to [this guide for migrating from `expo build`](https://docs.expo.dev/build-reference/migrating/).
## Other tips
### Use the App Store and Play Store data rather than the binary size as your benchmark
Let's address a common question: "Why is my app 50mb? I thought it was supposed to be around 20mb!"
Developers are often confused when they do a build of their app and see that the file we produce is actually in the order of 50mb rather than 20mb. The reason is that both Apple and Google have techniques for slicing your binaries up into binaries intended specifically for certain devices. We enable this on iOS automatically by building your standalone app with [bitcode enabled](https://developer.apple.com/documentation/xcode/reducing_your_app_s_size/doing_basic_optimization_to_reduce_your_app_s_size). On Android, we recommend that you build an [Android App Bundle (.aab)](https://developer.android.com/platform/technology/app-bundle) rather than an Android Application Package (.apk). Only once you have submitted the binaries to their respective stores will you be able to see the download size for various different device types.
### Use Android App Bundles
This file has been truncated. show original
1 Like
Hey @shahidcodes ,
In addition to @wodin ’s wonderful answer I’d like to add a link to the section that discusses a potential alternative to the Managed workflow called the Bare workflow which gives you the ability to select which modules you want bundled in. Workflows - Expo Documentation Just be sure to read all the differences so you understand the trade-offs between Managed and Bare.
Cheers,
Adam
1 Like
system
Closed
August 8, 2020, 11:58pm
4
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.