ryer.io

Solving React Native iOS Build Failures with rsync and Hermes

TL;DR

  • Encountered a React Native iOS build failure due to missing rsync files.
  • Identified that the issue was related to precompiled React Native dependencies.
  • Disabled precompilation and followed a thorough cleanup and reinstall process.
  • Successfully built and released the app by reverting to standard compilation practices.

Today was a slog through React Native iOS build failures. The saga began with my build failing repeatedly despite multiple efforts to clean and reinstall. Taking advice from online resources, I meticulously cleaned my drive data folder, deleted the Podfile lock and existing pods, and reinstalled them. Yet, the archive continued to fail.

Here’s what I tried step-by-step:

  1. Initial Diagnostics:

    • Validated basic settings in Xcode, including the signing team and bundle identifier.
    • Attempted to build directly from Xcode instead of the CLI—but that was a bust too.
  2. Error Diagnosis:

    • Faced with an error stating rsync couldn’t find certain files. This led me to check if rsync was installed locally.
    • Discovered the issue was tied to React Native dependencies, particularly around a missing directory related to the ARM64 architecture.
  3. Understanding the Problem:

    • From terminal history and logs, realized the React Native dependencies precompilation was not fully setting up Hermes directories.
    • The absence of a specific Hermes directory pointed to a deeper issue with the way precompiled binaries were being managed.
  4. Cleanup and Reinstallation:

    • Manually deleted the build folder, the pods, Podfile.lock, and the derived data.
    • Cleared Watchman cache to ensure no hidden dependencies were corrupting the build process.
  5. Reverting Compilation Strategy:

    • Disabled the new feature in my Podfile by removing the environment flag for React Native precompilation.
    • Opted for a clean slate by reinstalling everything without the new React Native dependencies feature.
  6. Rebuild and Success:

    • After purging all precompiled binaries and ensuring no residual directories were causing grief, the app finally built and released.
    • The core issue seems to have been a missing link or file in the precompiled setup—likely tied to Hermes not being fully compiled into the React Native core.

Reflecting on this, it looks like the promise of reducing build times through precompiled dependencies comes with its own set of challenges—especially when not all directories get properly set up. Disabling that feature and trusting the standard build process was the key to overcoming this particular hurdle. I’ll likely report this quirk to the React Native team and Hermes contributors for further scrutiny.

Back to basics worked, and while the journey was frustrating, it was a good reminder of the importance of investigating deeper when something seems off.