'Huge size difference between app bundles build by pure react native & expo bare workflow
I have build two app bundles for same application by pure react native (version 0.66) and expo bare workflow (expo eject, expo version: 42.0.1, react-native version: 0.63.4 )
Build by | App bundle size (mb) |
---|---|
Pure react native | 29 |
Expo bare (eject) | 14 |
There is a huge size difference (15 mb) between two app bundles.
When I looked into app bundles for my device I found that config.arm64_v8a.apk
has two different sizes.
Build by | config.arm64_v8a.apk (mb) |
base.apk(mb) |
---|---|---|
Pure react native | 18.2 | 12.2 |
Expo bare (eject) | 11.5 | 12.7 |
I couldn't find out why config.arm64_v8a.apk
has two file sizes in these two flows.
Why expo bare workflow app bundle is so small ? Is this because currently expo use react-native 0.63.4 or does expo has some additional app bundle size reducing method(s) ?
Thank you.
Solution 1:[1]
Expo has recently published a blog post about app bundling.
bundle sizes are also smaller by about 18% in “Hello World” apps. This is because many libraries are already shipped in an optimal format, and by needlessly transforming them with a random Babel cocktail, we increase the size, but only a little bit, and everywhere.
I think it's an interesting read (and good source!) for what you're looking for: https://blog.expo.dev/drastically-faster-bundling-in-react-native-a54f268e0ed1
Solution 2:[2]
Put android:extractNativeLibs="true" into the AndroidManifest.xml under application tag
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kipnoedels |
Solution 2 | Abhijeet Singh |