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
-
Create a new Expo project using npx create-expo-app myApp and navigate into it.
-
Install react-native-reanimated (version 4 or higher) using npx expo install react-native-reanimated.
-
Run npx expo prebuild to generate the native Android project.
-
Go into the android folder and run ./gradlew assembleRelease to confirm the project builds correctly with Gradle.
-
Install EAS CLI globally with npm install -g eas-cli if it is not already installed.
-
Run npx eas build:configure and set up the project for Android builds.
-
Execute a local EAS build using npx eas build --platform android --local.
-
Wait for the build to fail with a Ninja error indicating that libworklets.so is missing.
-
Verify that the build was executed inside /tmp/eas-build-local-nodejs/....
-
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
Description
EAS Local Build Fails on macOS —
libworklets.soMissingThe Problem
When running
npx eas build --platform android --local, the build fails with:This only happens with EAS local builds on macOS. EAS Cloud builds and direct
./gradlew assembleReleasework fine.Root Cause
On macOS,
/tmpis 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.sofiles 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 previewOr set it permanently in your shell (
~/.zshrc):Then run EAS local builds normally — no extra flags needed.
Affected Versions
/tmp->/private/tmpsymlink is universal)What Doesn't Work
org.gradle.parallel=false)ANDROID_NDK_HOMEeas-build-post-install)Related Issues
Steps to reproduce
Create a new Expo project using
npx create-expo-app myAppand navigate into it.Install
react-native-reanimated(version 4 or higher) usingnpx expo install react-native-reanimated.Run
npx expo prebuildto generate the native Android project.Go into the
androidfolder and run./gradlew assembleReleaseto confirm the project builds correctly with Gradle.Install EAS CLI globally with
npm install -g eas-cliif it is not already installed.Run
npx eas build:configureand set up the project for Android builds.Execute a local EAS build using
npx eas build --platform android --local.Wait for the build to fail with a Ninja error indicating that
libworklets.sois missing.Verify that the build was executed inside
/tmp/eas-build-local-nodejs/....Confirm that
/tmpis a symlink to/private/tmpon 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