Skip to content

EAS Local Build Fails on macOS [Error and temporal Solution] #9151

@joncodeofficial

Description

@joncodeofficial

Description

EAS Local Build Fails on macOS — libworklets.so Missing

The Problem

When running npx eas build --platform android --local, the build fails with:

ninja: error: '...react-native-worklets/android/build/intermediates/cmake/release/obj/arm64-v8a/libworklets.so',
needed by '...libexpo-modules-core.so', missing and no known rule to make it

This only happens with EAS local builds on macOS. EAS Cloud builds and direct ./gradlew assembleRelease work fine.

Root Cause

On macOS, /tmp is a symlink to /private/tmp. EAS local builds copy the project to /tmp/eas-build-local-nodejs/... by default.

CMake and Ninja have a known bug where they mix logical paths (/tmp/...) with physical paths (/private/tmp/...) when resolving paths through symlinks. This causes Ninja to look for .so files at a path that doesn't match where they were actually built.

The Fix

Tell EAS to use a directory that isn't behind a symlink:

EAS_LOCAL_BUILD_WORKINGDIR=$HOME/tmp/eas-build npx eas build --platform android --local --profile preview

Or set it permanently in your shell (~/.zshrc):

export EAS_LOCAL_BUILD_WORKINGDIR="$HOME/tmp/eas-build"

Then run EAS local builds normally — no extra flags needed.

Affected Versions

  • macOS (any version — /tmp -> /private/tmp symlink is universal)
  • react-native-reanimated 4.x + react-native-worklets
  • Any Expo SDK using expo-modules-core with native C++ dependencies
  • Any AGP version

What Doesn't Work

  • Patching expo-modules-core or react-native-reanimated Gradle files
  • Disabling Gradle parallel builds (org.gradle.parallel=false)
  • Setting ANDROID_NDK_HOME
  • Changing CMake versions
  • EAS build hooks (eas-build-post-install)

Related Issues

Steps to reproduce

  1. Create a new Expo project using npx create-expo-app myApp and navigate into it.

  2. Install react-native-reanimated (version 4 or higher) using npx expo install react-native-reanimated.

  3. Run npx expo prebuild to generate the native Android project.

  4. Go into the android folder and run ./gradlew assembleRelease to confirm the project builds correctly with Gradle.

  5. Install EAS CLI globally with npm install -g eas-cli if it is not already installed.

  6. Run npx eas build:configure and set up the project for Android builds.

  7. Execute a local EAS build using npx eas build --platform android --local.

  8. Wait for the build to fail with a Ninja error indicating that libworklets.so is missing.

  9. Verify that the build was executed inside /tmp/eas-build-local-nodejs/....

  10. Confirm that /tmp is a symlink to /private/tmp on macOS, which causes the path resolution issue leading to the error.

Snack or a link to a repository

https://github.com/joncodeofficial

Reanimated version

4.0.0

Worklets version

0.6.1

React Native version

0.81.5

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

New Architecture (Fabric renderer)

Reanimated feature flags

None

React Native release level

Stable

Build type

No response

Device

Real device

Host machine

macOS

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

Labels

Missing infoThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenarioPlatform: iOSThis issue is specific to iOS

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions