question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

APK gained size after 0.62, enableVmCleanup not working

See original GitHub issue

After upgrading to RN 0.62 our release android APK gained size. This is because libhermes-inspector.so and libhermes-executor-debug.so files are now bundled with our release APK:

image

There’s code which is supposed to strip these files, governed by enableVmCleanup variable which is true by default: https://github.com/facebook/react-native/blob/master/react.gradle#L310 but it is not executed anymore (the files to delete are not found)

We’re using android gradle plugin v. 3.6.3

React Native version:

System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 2.45 GB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 8.16.0 - /var/folders/hl/xrvrwgcs4g3_pwb1vgz767rc0000gp/T/yarn--1590683523594-0.7003201588515626/node
    Yarn: 1.22.4 - /var/folders/hl/xrvrwgcs4g3_pwb1vgz767rc0000gp/T/yarn--1590683523594-0.7003201588515626/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v8.16.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /Users/denyskniazhev/.rvm/gems/ruby-2.6.5/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 27, 28, 29
      Build Tools: 28.0.2, 28.0.3, 29.0.2
      System Images: android-23 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6392135
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_221 - /usr/bin/javac
    Python: 2.7.10 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0
    react-native: 0.62.2 => 0.62.2
  npmGlobalPackages:
    *react-native*: Not Found

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
heroiccommented, Jun 2, 2020

@denisk20

Add this to your app/build.gradle under packagingOptions:

def taskName = getGradle().getStartParameter().getTaskRequests().toString() exclude "/libjsc*.so" if (taskName.contains(“Debug”)) { // Release libs take precedence and must be removed // to allow debugging exclude '/libhermes-executor-release.so’ } else { // Reduce size by deleting the debugger/inspector exclude ‘/libhermes-inspector.so’ exclude '/libhermes-executor-debug.so’ }

0reactions
stale[bot]commented, Oct 4, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Known issues with Android Studio and Android Gradle Plugin
This update causes an underlying behavior change related to signing keys. When you navigate to Build > Generate Signed Bundle / APK and...
Read more >
android - Build and Install unsigned apk on device without the ...
React Version 0.62.1. In your root project directory. Make sure you have already directory android/app/src/main/assets/, if not create directory, after that ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found