Skip to content

Android source builds fail at configureBuildForHermes since facebook/hermes moved to meta/hermes #59587

Closed

Description

@mozzius

Description

Since facebook/hermes moved to meta/hermes (2026-10-28), building React Native from source on Android fails at :packages:react-native:ReactAndroid:hermes-engine:configureBuildForHermes.

Cause:

  • downloadHermes fetches https://github.com/facebook/hermes/tarball/<tag>. That URL now redirects (301) to meta/hermes, so the download itself still works.

  • GitHub names a tarball's top-level folder <owner>-<repo>-<sha>, so it is now meta-hermes-<sha>/ rather than facebook-hermes-<sha>/:

    $ curl -sL https://github.com/facebook/hermes/tarball/hermes-v260318099.0.2 | tar -tz | head -1
    meta-hermes-4188b63/
    
  • unzipHermes only flattens entries that start with facebook-hermes-. So Hermes is extracted to sdks/hermes/meta-hermes-<sha>/, and CMake finds no CMakeLists.txt in sdks/hermes.

Who's affected: anyone building React Native from source on Android, e.g. via includeBuild + dependencySubstitution or Expo's buildReactNativeFromSource, whenever Hermes has to be downloaded again (CI, fresh clones, fresh node_modules). Apps using the prebuilt artifacts don't download Hermes, so they're unaffected. main (as of dee5bb5) and 0.88-stable both still have the facebook-hermes- check.

Proposed fix: strip the tarball's single top-level folder unconditionally, the same way the folly, fmt and fast_float download tasks in ReactAndroid/build.gradle.kts already do. That no longer depends on the repo owner and behaves the same for the old tarballs. Pointing the download URL at meta/hermes would also stop relying on the redirect. I'll open a PR.

(Not the same as #59514, which touches the same file but is about a stale CMake cache after the source directory moves.)

Steps to reproduce

  1. Clone https://github.com/mozzius/hermes-tarball-repro. It's the community reproducer template (React Native 0.88.1) with one change: android/settings.gradle builds React Native from source.
  2. Run cd ReproducerApp && yarn && cd android && ./gradlew :app:assembleDebug -PreactNativeArchitectures=arm64-v8a.
  3. The build fails within about 30 seconds at configureBuildForHermes (log below).

The repo's fixed branch applies the proposed change with patch-package. With it, unzipHermes, configureBuildForHermes, buildHermesC and prepareHeadersForPrefab all pass, and CMakeLists.txt lands directly in sdks/hermes.

React Native Version

0.88.1

Affected Platforms

Runtime - Android, Build - MacOS

Output of npx @react-native-community/cli info

System:
  OS: macOS 27.0.1
  CPU: (14) arm64 Apple M4 Pro
  Shell:
    version: 5.3.20
    path: /opt/homebrew/bin/bash
Binaries:
  Node:
    version: 24.22.1
  Yarn:
    version: 1.22.22
  npm:
    version: 11.19.1
  Watchman:
    version: 2026.10.19.00
SDKs:
  Android SDK:
    API Levels:
      - "35"
      - "36"
      - "37"
    Build Tools:
      - 36.0.0
      - 37.0.0
IDEs:
  Android Studio: 2026.1 AI-261.26222.65.2614.16379836
Languages:
  Java:
    version: 17.0.20.1
npmPackages:
  "@react-native-community/cli":
    installed: 20.2.0
    wanted: 20.2.0
  react:
    installed: 19.3.0
    wanted: 19.3.0
  react-native:
    installed: 0.88.1
    wanted: 0.88.1
Android:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

> Task :react-native:packages:react-native:ReactAndroid:hermes-engine:downloadHermes
> Task :react-native:packages:react-native:ReactAndroid:hermes-engine:unzipHermes

> Task :react-native:packages:react-native:ReactAndroid:hermes-engine:configureBuildForHermes FAILED
CMake Error: The source directory ".../ReproducerApp/node_modules/react-native/sdks/hermes" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native:packages:react-native:ReactAndroid:hermes-engine:configureBuildForHermes'.
> Process 'command '.../cmake/3.30.5/bin/cmake'' finished with non-zero exit value 1

BUILD FAILED in 30s

MANDATORY Reproducer

https://github.com/mozzius/hermes-tarball-repro

Screenshots and Videos

No response

Activity

  1. mozzius commented on Oct 28, 2026

    @mozzius
    ContributorAuthor

    Fixed by #59589

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions