react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

ninja: error: '.../react-android-0.82.1-debug/.../libreactnative.so', needed by .../libworklets.so, missing and no known rule to make it

Open Naresh-Dhamu opened this issue 2 months ago β€’ 5 comments

Description

After upgrading my project from React Native 0.75.3 β†’ React Native 0.82.1, the Android build started failing when using react-native-reanimated (and its react-native-worklets dependency).

The CMake/Ninja build fails with this error:

Task :react-native-worklets:buildCMakeDebug[armeabi-v7a][worklets] FAILED ninja: error: '/Users/zezo/.gradle/caches/9.0.0/transforms/.../react-android-0.82.1-debug/prefab/modules/reactnative/libs/android.armeabi-v7a/libreactnative.so', needed by '../../../../build/intermediates/cxx/Debug/.../obj/armeabi-v7a/libworklets.so', missing and no known rule to make it

It seems libreactnative.so for the armeabi-v7a ABI is not generated or included in the react-android prefab for React Native 0.82.1.

React Native version: Before: "react-native": "0.75.3" Now: "react-native": "0.82.1"

Reanimated version: "react-native-reanimated": "^4.1.3",

Environment

macOS: 15.6.1 Android Gradle Plugin: 9.0.0 NDK: 27.1.12297006 CMake: 4.1.1 JDK: 17.0.17

Steps to reproduce

  1. Start with a React Native 0.75.3 app (works fine).
  2. Upgrade to React Native 0.82.1.
  3. Install react-native-reanimated and react-native-worklets.
  4. Run npx react-native run-android.
  5. Build fails at: react-native-worklets:buildCMakeDebug[armeabi-v7a][worklets]

Snack or a link to a repository

private repo (not share publicly)

Reanimated version

4.1.3

Worklets version

0.6.1

React Native version

0.82.1

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

Debug app & dev bundle

Device

Real device

Host machine

macOS

Device model

vivo y200

Acknowledgements

No

Naresh-Dhamu avatar Oct 30 '25 16:10 Naresh-Dhamu

Hi @Naresh-Dhamu, thanks for reporting this issue.

Please try removing all build artifacts (with rm -rf node_modules android/build android/app/build android/.cxx android/app/.cxx or with git clean -fdX – note that this will remove all untracked files, including things like .env etc.) and try to build the app again.

tomekzaw avatar Nov 03 '25 09:11 tomekzaw

I've been having this issue consistently with a bunch of apps on several machines. Removing node_modules and the android directory doesn't fix it.

I have a repo that consistently fails on my 2 laptops. I have a lot more that fail, but this one is public.

New expo apps seem to work.

I tried a bunch of things, like removing ~/.gradle, updating my Android SDKs to the latest, updating Node version, but nothing seems to help.

Happy to provide any more details. Any suggestions or things I could try would be really helpful. πŸ™

➜  ~ node --version 
v24.5.0
➜  ~ pnpm --version
10.20.0
➜  sandbox git clone https://github.com/beeman/test-expo-web3js-wallet-ui test-app
➜  sandbox cd test-app
➜  test-app git:(main) pnpm install
➜  test-app git:(main) pnpm run android

Full output can be seen in this gist: https://gist.github.com/beeman/3ac09000727f2e95b9b786582745a149

I created this script that gets me into the error state directly. @Naresh-Dhamu curious to hear if this is the same for you πŸ™

beeman avatar Nov 20 '25 17:11 beeman

Here is the full output from the Android build.

The repo with the generated project is here

➜  sandbox ~/dev/beeman/expo-reanimated-build-issue/clean-expo-app.sh
App name        : app-2025-11-25-03-11-48
Package manager : pnpm
----------------------------------------
Running install command : 'pnpm create expo-app@latest app-2025-11-25-03-11-48'
----------------------------------------
.../19ab8234275-c1be                     |   +1 +
.../19ab8234275-c1be                     | Progress: resolved 1, reused 1, downloaded 0, added 1, done
Creating an Expo project using the default template.

To choose from all available templates (https://github.com/expo/expo/tree/main/templates) pass in the --template arg:
  $ pnpx create-expo-app --template

To choose from all available examples (https://github.com/expo/examples) pass in the --example arg:
  $ pnpx create-expo-app --example

βœ” Downloaded and extracted project files.
> pnpm config --location project set node-linker hoisted
> pnpm install
 WARN  Request took 10473ms: https://registry.npmjs.org/@typescript-eslint%2Ftypes
 WARN  3 deprecated subdependencies found: [email protected], [email protected], [email protected]
Packages: +952
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 918, reused 872, downloaded 13, added 952, done
Done in 31.2s using pnpm v10.22.0

βœ… Your project is ready!

To run your project, navigate to the directory and run one of the following pnpm commands.

- cd app-2025-11-25-03-11-48
- pnpm run android
- pnpm run ios
- pnpm run web
----------------------------------------
Expo app created successfully!
----------------------------------------
Changing directory to 'app-2025-11-25-03-11-48'
----------------------------------------
Running build command : 'pnpm expo run:android'
----------------------------------------
β€Ί Android package name: com.anonymous.app20251125031148
βœ” Created native directory
βœ” Updated package.json
βœ” Finished prebuild
β€Ί Opening emulator Pixel_8_Pro
β€Ί Building app...
Starting a Gradle Daemon (subsequent builds will be faster)
Configuration on demand is an incubating feature.

> Configure project :
[ExpoRootProject] Using the following versions:
  - buildTools:  36.0.0
  - minSdk:      24
  - compileSdk:  36
  - targetSdk:   36
  - ndk:         27.1.12297006
  - kotlin:      2.1.20
  - ksp:         2.1.20-2.0.1

> Configure project :expo

Using expo modules
  - expo-constants (18.0.10)
  - expo-modules-core (3.0.26)
  - [πŸ“¦] expo-asset (12.0.10)
  - [πŸ“¦] expo-file-system (19.0.19)
  - [πŸ“¦] expo-font (14.0.9)
  - [πŸ“¦] expo-haptics (15.0.7)
  - [πŸ“¦] expo-image (3.0.10)
  - [πŸ“¦] expo-keep-awake (15.0.7)
  - [πŸ“¦] expo-linking (8.0.9)
  - [πŸ“¦] expo-splash-screen (31.0.11)
  - [πŸ“¦] expo-system-ui (6.0.8)
  - [πŸ“¦] expo-web-browser (15.0.9)


> Task :expo-modules-core:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :app:processDebugMainManifest
/private/tmp/sandbox/app-2025-11-25-03-11-48/android/app/src/debug/AndroidManifest.xml:6:5-162 Warning:
        application@android:usesCleartextTraffic was tagged at AndroidManifest.xml:6 to replace other declarations but no other declaration present
/private/tmp/sandbox/app-2025-11-25-03-11-48/android/app/src/debug/AndroidManifest.xml Warning:
        provider#expo.modules.filesystem.FileSystemFileProvider@android:authorities was tagged at AndroidManifest.xml:0 to replace other declarations but no other declaration present

> Task :expo-constants:compileDebugKotlin
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo-constants/android/src/main/java/expo/modules/constants/ConstantsModule.kt:12:5 'fun Constants(legacyConstantsProvider: () -> Map<String, Any?>): Unit' is deprecated. Use `Constant` or `Property` instead.

> Task :react-native-reanimated:buildCMakeDebug[arm64-v8a][reanimated] FAILED
C/C++: ninja: error: '/private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/react-native-worklets/android/build/intermediates/cmake/debug/obj/arm64-v8a/libworklets.so', needed by '../../../../build/intermediates/cxx/Debug/653d2d6m/obj/arm64-v8a/libreanimated.so', missing and no known rule to make it

> Task :expo:compileDebugKotlin
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ExpoModulesPackage.kt:34:16 This declaration overrides a deprecated member but is not marked as deprecated itself. Add the '@Deprecated' annotation or suppress the diagnostic.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ExpoReactHostFactory.kt:8:8 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ExpoReactHostFactory.kt:80:22 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:24:8 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:58:33 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:105:16 This declaration overrides a deprecated member but is not marked as deprecated itself. Add the '@Deprecated' annotation or suppress the diagnostic.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:105:38 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:113:16 This declaration overrides a deprecated member but is not marked as deprecated itself. Add the '@Deprecated' annotation or suppress the diagnostic.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:114:21 'val reactInstanceManager: ReactInstanceManager' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:168:36 'constructor(activity: Activity, reactNativeHost: ReactNativeHost?, appKey: String?, launchOptions: Bundle?, fabricEnabled: Boolean): ReactDelegate' is deprecated. Deprecated since 0.81.0, use one of the other constructors instead.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:279:77 'val reactInstanceManager: ReactInstanceManager' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:282:22 'val reactInstanceManager: ReactInstanceManager' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:286:54 'val reactInstanceManager: ReactInstanceManager' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt:6:8 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt:15:9 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt:47:60 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapperBase.kt:7:8 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapperBase.kt:16:23 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapperBase.kt:89:16 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/ReactNativeHostWrapperBase.kt:101:38 'class ReactNativeHost : Any' is deprecated. Deprecated in Java.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/fetch/ExpoFetchModule.kt:30:39 'constructor(reactContext: ReactContext): ForwardingCookieHandler' is deprecated. Use the default constructor.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/fetch/NativeResponse.kt:42:16 This declaration overrides a deprecated member but is not marked as deprecated itself. Add the '@Deprecated' annotation or suppress the diagnostic.
w: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/expo/android/src/main/java/expo/modules/fetch/NativeResponse.kt:44:11 'fun deallocate(): Unit' is deprecated. Use sharedObjectDidRelease() instead.

[Incubating] Problems report is available at: file:///private/tmp/sandbox/app-2025-11-25-03-11-48/android/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-reanimated:buildCMakeDebug[arm64-v8a][reanimated]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/react-native-reanimated/android/.cxx/Debug/653d2d6m/arm64-v8a'
  [0/2] Re-checking globbed directories...

  C++ build system [build] failed while executing:
      /Users/beeman/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/react-native-reanimated/android/.cxx/Debug/653d2d6m/arm64-v8a \
        reanimated
    from /private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/react-native-reanimated/android
  ninja: error: '/private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/react-native-worklets/android/build/intermediates/cmake/debug/obj/arm64-v8a/libworklets.so', needed by '../../../../build/intermediates/cxx/Debug/653d2d6m/obj/arm64-v8a/libreanimated.so', missing and no known rule to make it

* 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.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.14.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 25s
243 actionable tasks: 143 executed, 100 from cache
Error: /private/tmp/sandbox/app-2025-11-25-03-11-48/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a exited with non-zero code: 1
Error: /private/tmp/sandbox/app-2025-11-25-03-11-48/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a exited with non-zero code: 1
    at ChildProcess.completionListener (/private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/@expo/spawn-async/src/spawnAsync.ts:67:13)
    at Object.onceWrapper (node:events:622:26)
    at ChildProcess.emit (node:events:507:28)
    at maybeClose (node:internal/child_process:1101:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
    ...
    at spawnAsync (/private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/@expo/spawn-async/src/spawnAsync.ts:28:21)
    at spawnGradleAsync (/private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/@expo/cli/src/start/platforms/android/gradle.ts:134:28)
    at assembleAsync (/private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/@expo/cli/src/start/platforms/android/gradle.ts:83:16)
    at runAndroidAsync (/private/tmp/sandbox/app-2025-11-25-03-11-48/node_modules/@expo/cli/src/run/android/runAndroidAsync.ts:62:24)

beeman avatar Nov 24 '25 23:11 beeman

You're trying to build app in /tmp (linked to /private/tmp on macOS). See https://github.com/expo/expo/issues/40525.

tomekzaw avatar Nov 24 '25 23:11 tomekzaw

Hey! πŸ‘‹

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

github-actions[bot] avatar Nov 24 '25 23:11 github-actions[bot]