Skip to content

Hermes emit binary crash #25609

@mjmasn

Description

@mjmasn

When running with --variant release or doing a production build, the Hermes emit binary step fails, leaving a 0 byte bundle file. It looks like something to do with overwriting the same file, as if I cancel the build before the hermes step, then manually run the command from the Program arguments below but with a different output path, it works fine and the bytecode bundle is saved correctly.

Stack dump:
0.	Program arguments: ../../node_modules/hermesvm/linux64-bin/hermes -emit-binary -out /REDACTED/android/app/build/generated/assets/react/release/index.android.bundle /REDACTED/android/app/build/generated/assets/react/release/index.android.bundle -O -output-source-map 
1.	Program arguments: ../../node_modules/hermesvm/linux64-bin/hermes -emit-binary -out /REDACTED/android/app/build/generated/assets/react/release/index.android.bundle /REDACTED/android/app/build/generated/assets/react/release/index.android.bundle -O -output-source-map 
[0x41ba83]
[0x41abc9]
[0x41ac6c]
[0x4265e0]
[0x499f43]
[0x49a163]
[0x43d7ff]
[0x43d967]
[0x44003a]
[0x4399b2]
[0x439b32]
[0x42b8b9]
[0x4308d6]
[0x40487b]
[0x712f34]
[0x7131b1]
[0x408116]
[0x41ba83]
[0x41abc9]
[0x41ac6c]
[0x4265e0]
[0x499f43]
[0x49a163]
[0x43d7ff]
[0x43d967]
[0x44003a]
[0x4399b2]
[0x439b32]
[0x42b8b9]
[0x4308d6]
[0x40487b]
[0x712f34]
[0x7131b1]
[0x408116]

FAILURE: Build failed with an exception.

* Where:
Script '/REDACTED/android/app/react.gradle' line: 150

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command '../../node_modules/hermesvm/linux64-bin/hermes'' finished with non-zero exit value 135

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 57s

React Native version:

System:
    OS: Linux 4.15 Ubuntu 16.04.6 LTS (Xenial Xerus)
    CPU: (8) x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
    Memory: 2.09 GB / 15.54 GB
    Shell: 4.3.48 - /bin/bash
  Binaries:
    Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
    Yarn: 1.16.0 - /usr/bin/yarn
    npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    Android SDK:
      API Levels: 22, 24, 26, 27, 28, 29
      Build Tools: 23.0.1, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.3, 28.0.2, 28.0.3, 29.0.0
      System Images: android-22 | Google APIs Intel x86 Atom_64, android-24 | Google APIs ARM 64 v8a, android-24 | Google APIs Intel x86 Atom, android-24 | Google APIs Intel x86 Atom_64, android-24 | Google Play Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64
      Android NDK: 17.1.4828580
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: ^0.60.3 => 0.60.3 
  npmGlobalPackages:
    create-react-native-app: 2.0.2
    react-native-cli: 2.0.1
    react-native-create-library: 3.1.2
    react-native-git-upgrade: 0.2.7

Steps To Reproduce

  1. Try creating a Hermes-enabled release build
  2. 💥

Describe what you expected to happen:
The build to succeed.

Snack, code example, or link to a repository:
Any new RN 0.60.3 app, but I made an example at https://github.com/mjmasn/HermesApp

  1. Clone the repo
  2. Run yarn
  3. Run yarn start
  4. In a second terminal window run react-native run-android --variant release
  5. Build fails

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPlatform: LinuxBuilding on Linux.StaleThere has been a lack of activity on this issue and it may be closed soon.Tech: HermesHermes Engine: https://hermesengine.dev/

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions