Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

APK file is larger with react-native 0.59 #24154

Closed
Thebarda opened this issue Mar 26, 2019 · 8 comments
Closed

APK file is larger with react-native 0.59 #24154

Thebarda opened this issue Mar 26, 2019 · 8 comments
Labels
Bug Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.

Comments

@Thebarda
Copy link

馃悰 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

Screenshot from 2019-03-26 16-45-12

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
@cpojer
Copy link
Contributor

cpojer commented Mar 26, 2019

This is expected. With 0.59 we shipped a new version of JSC which is both a ton faster and 64-bit compatible. Unfortunately for now we have to live with the size increase but we are working on removing several modules from React Native at the moment: #23313.

@cpojer cpojer closed this as completed Mar 26, 2019
@Thebarda
Copy link
Author

I completly understand that the addition of JSC make APK file larger than before but is it normal that both libjsc.so and libc++_shared.so are huge compare to the other '.so' in the APK ?

@nes123
Copy link

nes123 commented Apr 7, 2019

did you find information about that? the increase in size does not seem reasonable. BTW in my case it is 9.6MB and 4.6MB respectively.

@sridhar-vadlamani-ck
Copy link

Our app size increased by about 7MB. If the increase is similar for others, I see a lot of people sticking with 0.58.

@Thebarda
Copy link
Author

Thebarda commented May 3, 2019

@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

@kaiwen-zhang-ck
Copy link

@Thebarda good point, i will do a comparison and see how much increase we are getting

@mannodermaus
Copy link

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):
Screen Shot 2019-05-10 at 13 03 16

0.59.5 (File size: 12704300 bytes):
Screen Shot 2019-05-10 at 13 02 52

@arnavzoman
Copy link

How can we strip these ourselves if we build from source ?

@facebook facebook locked as resolved and limited conversation to collaborators Mar 26, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

8 participants