APK file is larger with react-native 0.59
See original GitHub issue🐛 Bug Report
After building my arm APK, I noted that APK file increased by about 3 MB. With Android Studio, I analyzed that APK I found two unstripped .so files, libjsc.so and libc++_shared.so, they respectively size 12.7MB and 5.7MB.
To Reproduce
npm install
then
unzip -l node_modules/react-native/android/com/facebook/react/react-native/0.59.2/react-native-0.59.2.aar
Expected Behavior
These two files must be stripped to reduce their size and, so, to reduce APK file size.
Code Example
Environment
React Native Environment Info:
System:
OS: Linux 4.18 Ubuntu 18.10 (Cosmic Cuttlefish)
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 160.84 MB / 15.39 GB
Shell: 4.4.19 - /bin/bash
Binaries:
Node: 8.11.4 - /usr/bin/node
Yarn: 1.12.3 - /usr/bin/yarn
npm: 6.9.0 - ~/.npm-global/bin/npm
SDKs:
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 23.0.3, 27.0.3, 28.0.3
System Images: android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom
npmPackages:
react: ^16.4.1 => 16.8.5
react-native: ^0.59.2 => 0.59.2
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
react-native-rename: 2.2.2
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top Results From Across the Web
React Native initial App size is too large - Stack Overflow
Using Android App Bundle(aab) will slightly reduce apk size (>=8Mb). To generate Android App ... APK file is larger with react-native 0.59.
Read more >Releasing React Native 0.59
Lean core is underway ... React Native is a large and complex project with a complicated repository. This makes the codebase less approachable ......
Read more >Make your React Native app 3x smaller with one simple ...
It also means that if you are upgrading to 0.59 your APK size will grow by roughly 10MB. In this article we show...
Read more >Optimising React Native APK Size - Medium
Android App apk size and App performance has always been a major concern for React Native Developers. And our app being written in...
Read more >Upgrade to React Native 0.59 - Matt Oakes
properties file. You can also remove the wrapper Gradle task. This no longer required as it duplicates the Gradle version setting. buildscript {...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We are seeing a similar size increase (around 4 MB for us) after upgrading from React Native 0.57.8 to 0.59.5. Comparing, for instance,
lib/x86/libjsc.so
in both versions yields the same observations that @Thebarda made; the newer version seems to not be stripped.0.57.8 (File size: 4614240 bytes):
0.59.5 (File size: 12704300 bytes):
@sridhar-vadlamani-ck Do you splits your application into multiple APK ? Splitting you app into an APK for each architecture could reduce that increase. The big advantage of the new 0.59 is that you can generate an APK for 64-bit architectures