react-native-reanimated: Can not build reanimated V3 on React Native 0.72.1 and Android "ld: error: undefined symbol: folly::dynamic::dynamic(folly::dynamic&&)"

Description

Can’t build reanimated V3 on Android, getting an LD error complaining about an “undefined symbol”. I am using a MacBook Air M1. Running macOS Ventura 13.4.1 NDK version: 23.1.7779620 React Native version: 0.72.1

> Task :react-native-reanimated:buildCMakeRelWithDebInfo[arm64-v8a] FAILED
C/C++: ninja: Entering directory `/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/android/.cxx/RelWithDebInfo/q326e5e2/arm64-v8a'
C/C++: ld: error: undefined symbol: folly::dynamic::dynamic(folly::dynamic&&)
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-reanimated:buildCMakeRelWithDebInfo[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/android/.cxx/RelWithDebInfo/q326e5e2/arm64-v8a'
  [0/2] Re-checking globbed directories...
  [1/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/ShadowTreeCloner.cpp.o
  [2/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/FabricUtils.cpp.o
  [3/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/ReanimatedUIManagerBinding.cpp.o
  [4/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Registries/NewestShadowNodesRegistry.cpp.o
  [5/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/FeaturesConfig.cpp.o
  [6/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/ReanimatedVersion.cpp.o
  [7/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp.o
  [8/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/JsiUtils.cpp.o
  [9/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedRuntime.cpp.o
  [10/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp.o
  [11/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp.o
  [12/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/AndroidLogger.cpp.o
  [13/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/SharedItems/Shareables.cpp.o
  [14/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/WorkletEventHandler.cpp.o
  [15/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Registries/EventHandlerRegistry.cpp.o
  [16/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp.o
  [17/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/Scheduler.cpp.o
  [18/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/TurboModule.cpp.o
  [19/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/AndroidErrorHandler.cpp.o
  [20/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/AndroidScheduler.cpp.o
  [21/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/LayoutAnimations.cpp.o
  [22/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o
  [23/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/OnLoad.cpp.o
  [24/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/RuntimeDecorator.cpp.o
  [25/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModule.cpp.o
  [26/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/NativeProxy.cpp.o
  [27/27] Linking CXX shared library ../../../../build/intermediates/cxx/RelWithDebInfo/q326e5e2/obj/arm64-v8a/libreanimated.so
  FAILED: ../../../../build/intermediates/cxx/RelWithDebInfo/q326e5e2/obj/arm64-v8a/libreanimated.so 
  : && /Users/ahmetefeakyazi/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --sysroot=/Users/ahmetefeakyazi/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -frtti -stdlib=libc++ -DREACT_NATIVE_MINOR_VERSION=72 -DREANIMATED_VERSION=3.3.0 -DHERMES_ENABLE_DEBUGGER=0 -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all -std=c++17 -Wall -Werror -DJS_RUNTIME_HERMES=1 -O2 -g -DNDEBUG  -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Qunused-arguments -Wl,--no-undefined -shared -Wl,-soname,libreanimated.so -o ../../../../build/intermediates/cxx/RelWithDebInfo/q326e5e2/obj/arm64-v8a/libreanimated.so CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/FabricUtils.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/ReanimatedUIManagerBinding.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/ShadowTreeCloner.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModule.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedRuntime.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Registries/EventHandlerRegistry.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Registries/NewestShadowNodesRegistry.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/SharedItems/Shareables.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/FeaturesConfig.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/JsiUtils.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/ReanimatedVersion.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/RuntimeDecorator.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/Scheduler.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/WorkletEventHandler.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/AndroidErrorHandler.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/AndroidLogger.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/AndroidScheduler.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/LayoutAnimations.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/NativeProxy.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/OnLoad.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/TurboModule.cpp.o  -llog  -landroid  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/folly_runtime/libs/android.arm64-v8a/libfolly_runtime.so  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/glog/libs/android.arm64-v8a/libglog.so  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/reactnativejni/libs/android.arm64-v8a/libreactnativejni.so  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/34c2120d0d3cd8dc97826fc02c9e8fc4/transformed/jetified-fbjni-0.3.0/prefab/modules/fbjni/libs/android.arm64-v8a/libfbjni.so  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/e1925d27dfeda554a62fa91e748dc57a/transformed/jetified-hermes-android-0.72.1-release/prefab/modules/libhermes/libs/android.arm64-v8a/libhermes.so   -latomic -lm && :
  ld: error: undefined symbol: folly::dynamic::dynamic(folly::dynamic&&)
  >>> referenced by NativeArray.h:40 (/Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/reactnativejni/include/react/jni/NativeArray.h:40)
  >>>               CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o:(facebook::jni::basic_strong_ref<facebook::jni::HybridClass<facebook::react::ReadableNativeArray, facebook::react::NativeArray>::JavaPart, facebook::jni::LocalReferenceAllocator> facebook::jni::HybridClass<facebook::react::ReadableNativeArray, facebook::react::NativeArray>::newObjectCxxArgs<folly::dynamic>(folly::dynamic&&))
  >>> referenced by NativeMap.h:40 (/Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/reactnativejni/include/react/jni/NativeMap.h:40)
  >>>               CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o:(facebook::jni::basic_strong_ref<facebook::jni::HybridClass<facebook::react::ReadableNativeMap, facebook::react::NativeMap>::JavaPart, facebook::jni::LocalReferenceAllocator> facebook::jni::HybridClass<facebook::react::ReadableNativeMap, facebook::react::NativeMap>::newObjectCxxArgs<folly::dynamic>(folly::dynamic&&))
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.
  
  C++ build system [build] failed while executing:
      /Users/ahmetefeakyazi/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/android/.cxx/RelWithDebInfo/q326e5e2/arm64-v8a \
        reanimated
    from /Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/android

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

See https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 48s
33 actionable tasks: 27 executed, 6 up-to-date

Steps to reproduce

  1. Set Reanimated V3 up using NPM, tested it on iOS and it worked.
  2. Tried to build for android and got the error.
  3. Install different versions of NDK
  4. Set CMAKE version to 3.22.1

Snack or a link to a repository

Can not reproduce on other platforms

Reanimated version

3.3.0

React Native version

0.72.1

Platforms

Android, iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

Android emulator

Device model

AVD

Acknowledgements

Yes

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 41 (4 by maintainers)

Most upvoted comments

can you try with ndk 24.0.8215888?

“react-native-reanimated”: “^3.4.0-nightly-20230706-ca2bcda22”

I am getting the same error. Thanks for the suggestion, though.

Using sudo worked for me too, and I found a solution for my environment.

My .zshrc had the following variables and commenting out them solved the problem in my case.

export CPATH=/opt/homebrew/include
export LIBRARY_PATH=/opt/homebrew/lib

I’m not familiar with the C/C++ build system, but these seems to be common solutions for building C programs with packages installed by homebrew on Apple Silicon machines(such as M1).

macos - Installing a C/C++ library with homebrew on M1 Macs - Ask Different

I found this discussion on the expo discord which suggested that it’s probably just a polluted cache for the similar expo error (with expo-modules-core:buildCMakeDebug[arm64-v8a]) . What ended up fixing it for me was:

# Answer Y to all:
npx react-native-clean-project
cd android
rm -rf .gradle
# this will recursively force wipe any untracked files
git clean -dfx

Then npm install and run android.

Hello, guys! I’m pass for issue, which the frameProcessor can’t turn because reanimated V3 is not installed, however, already installed reanimated. Too the plugin are issue. Can anyone help me? Follow my code:

Imported: import React, { useState, useEffect } from ‘react’; import { Text, View, Button, TouchableOpacity, Alert } from ‘react-native’; import firestore from ‘@react-native-firebase/firestore’; import { Picker } from ‘@react-native-picker/picker’; import styles from ‘./styles’; import { NavigationContainer, useRoute } from ‘@react-navigation/native’; import { createStackNavigator } from ‘@react-navigation/stack’; import { TextInput } from ‘react-native-paper’; import MaterialCommunityIcons from ‘react-native-vector-icons/MaterialCommunityIcons’; import {Camera, useCameraDevices, useFrameProcessor} from ‘react-native-vision-camera’; import { runOnJS } from ‘react-native-reanimated’; import{ scanOCR } from ‘vision-camera-ocr’;

Code: const Cameracode = ({ navigation }) => { const [device, setDevice] = useState(null); const devices = useCameraDevices(); const [text, setText] = useState(‘’);

const frameProcessor = useFrameProcessor((frame)=>{ ‘worklet’; const data = scanOCR(frame);

runOnJS(setText)(data.result.text); }, []);

useEffect(() => { const fetchCameraDevice = async () => { const newCameraPermission = await Camera.requestCameraPermission(); console.log(‘Camera permission status:’, newCameraPermission);

console.log(‘Devices:’, devices);

const cameraDevice = devices.back; setDevice(cameraDevice); };

fetchCameraDevice(); }, [devices]);

return (

{device && (

)}

); };

Babel: module.exports = function(api) { api.cache(true); return{ presets: [‘module:metro-react-native-babel-preset’], plugins: [ [‘react-native-reanimated/plugin’, { globals: [‘__scanOCR’], } ], ], }; };

dependencies: “dependencies”: { “@react-native-firebase/app”: “^18.1.0”, “@react-native-firebase/database”: “^18.1.0”, “@react-native-firebase/firestore”: “^18.1.0”, “@react-native-picker/picker”: “^2.4.10”, “@react-navigation/bottom-tabs”: “^6.5.7”, “@react-navigation/material-top-tabs”: “^6.6.3”, “@react-navigation/native”: “^6.1.6”, “@react-navigation/stack”: “^6.3.17”, “accordion-collapse-react-native”: “^1.1.1”, “date-fns”: “^2.30.0”, “native-base”: “^3.4.28”, “react”: “18.2.0”, “react-native”: “0.71.8”, “react-native-autocomplete-dropdown”: “^3.0.2”, “react-native-collapsible”: “^1.6.1”, “react-native-gesture-handler”: “^2.12.0”, “react-native-modal-filter-picker”: “^2.1.0”, “react-native-pager-view”: “^6.2.0”, “react-native-paper”: “^5.9.1”, “react-native-picker-select”: “^8.0.4”, “react-native-progress-steps”: “^1.3.4”, “react-native-reanimated”: “^3.5.4”, “react-native-safe-area-context”: “^4.5.3”, “react-native-screens”: “^3.20.0”, “react-native-searchable-dropdown”: “^1.1.3”, “react-native-searchable-picker”: “^1.0.5”, “react-native-vector-icons”: “^9.2.0”, “react-native-vision-camera”: “^2.15.4”, “react-navigation”: “^4.4.4”, “vision-camera-ocr”: “^1.0.0” }, “devDependencies”: { “@babel/core”: “^7.20.0”, “@babel/preset-env”: “^7.20.0”, “@babel/runtime”: “^7.20.0”, “@react-native-community/eslint-config”: “^3.2.0”, “@tsconfig/react-native”: “^2.0.2”, “@types/jest”: “^29.2.1”, “@types/react”: “^18.0.24”, “@types/react-test-renderer”: “^18.0.0”, “babel-jest”: “^29.2.1”, “eslint”: “^8.19.0”, “jest”: “^29.2.1”, “metro-react-native-babel-preset”: “0.73.9”, “prettier”: “^2.4.1”, “react-test-renderer”: “18.2.0”, “typescript”: “4.8.4” }, “jest”: { “preset”: “react-native” } }

Error:

let workletRuntime = null let createWorklet = () => { throw new Error(“Reanimated V3 is not installed, Frame Processors are not available!”) }

try { const reanimated = require(‘react-native-reanimated’) if (reanimated.createWorkletRuntime == null) { console.warn(“Frame Processors are disabled because you’re using an incompatible version of Reanimated.”) } workletRuntime = reanimated.createWorkletRuntime(‘VisionCamera’) createWorklet = reanimated.makeShareableCloneRecursive } catch { // Frame Processors are not enabled }

export const FrameProcessorContext = { workletRuntime: workletRuntime, createWorklet: createWorklet }

This error too:

throw new Error([Reanimated] Tried to synchronously call a non-worklet function on the UI thread. See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#tried-to-synchronously-call-a-non-worklet-function-on-the-ui-thread` for more details.`); }; fun.__remoteFunction = objectToUnpack; return fun; } else { throw new Error(‘[Reanimated] Data type not recognized by value unpacker.’); } }

type ValueUnpacker = WorkletFunction< [objectToUnpack: any, category?: string], any

;

if (DEV && IS_NATIVE) { if (!(‘__workletHash’ in valueUnpacker)) { throw new Error(‘[Reanimated] valueUnpacker is not a worklet’); } const closure = (valueUnpacker as ValueUnpacker).__closure; if (closure !== undefined && Object.keys(closure).length !== 0) { throw new Error(‘[Reanimated] valueUnpacker must have empty closure’); } }

export function getValueUnpackerCode() { return (valueUnpacker as ValueUnpacker).__initData.code; }

Exist other lib which make this? I’m see which camera vision with many problems

This is due to the compiler system (CMake) find the wrong location for folly lib, before building, run command unset CPATH if echo $CPATH returns non empty value.

The same on me, i did everything (reinstall ndk, rm node_modules, rm gradle cache, reinstall…) but still not work ndk 23.1.7779620) Issue happen on mac m1 pro RN 0.72.4 But still can build on windows, so I think the problem come from my MacBook

Update: I figure out, the command work when run as root. But I don’t know how to fix this

Hi! Have anyone solved this? I am facing the same issue 😦

can you try with ndk 24.0.8215888?

What is ndk? I am getting same issue can you please explain

NDK is used in Android builds. In my case there were not any issues with iOS.

Ugh, dumb me.

I can not get a release build now.

Here is the log with the new NDK:

> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Android gradle plugin: 7.4.2
Gradle: 8.0.1
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

> Task :react-native-gesture-handler:processReleaseManifest
package="com.swmansion.gesturehandler" found in source AndroidManifest.xml: /Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-gesture-handler/android/src/main/AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

> Task :react-native-reanimated:processReleaseManifest
package="com.swmansion.reanimated" found in source AndroidManifest.xml: /Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/android/src/main/AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

> Task :react-native-reanimated:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :react-native-reanimated:buildCMakeRelWithDebInfo[arm64-v8a] FAILED
C/C++: ninja: Entering directory `/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/android/.cxx/RelWithDebInfo/6ot2r1v6/arm64-v8a'
C/C++: ld: error: undefined symbol: folly::dynamic::dynamic(folly::dynamic&&)
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-reanimated:buildCMakeRelWithDebInfo[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/android/.cxx/RelWithDebInfo/6ot2r1v6/arm64-v8a'
  [0/2] Re-checking globbed directories...
  [1/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/ShadowTreeCloner.cpp.o
  [2/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/ReanimatedUIManagerBinding.cpp.o
  [3/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/FabricUtils.cpp.o
  [4/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Registries/NewestShadowNodesRegistry.cpp.o
  [5/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/FeaturesConfig.cpp.o
  [6/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/ReanimatedVersion.cpp.o
  [7/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/JsiUtils.cpp.o
  [8/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp.o
  [9/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedRuntime.cpp.o
  [10/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp.o
  [11/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp.o
  [12/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/WorkletEventHandler.cpp.o
  [13/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/SharedItems/Shareables.cpp.o
  [14/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Registries/EventHandlerRegistry.cpp.o
  [15/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/Scheduler.cpp.o
  [16/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/AndroidLogger.cpp.o
  [17/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp.o
  [18/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/TurboModule.cpp.o
  [19/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/AndroidErrorHandler.cpp.o
  [20/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/AndroidScheduler.cpp.o
  [21/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/LayoutAnimations.cpp.o
  [22/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o
  [23/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/OnLoad.cpp.o
  [24/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/RuntimeDecorator.cpp.o
  [25/27] Building CXX object CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModule.cpp.o
  [26/27] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/NativeProxy.cpp.o
  [27/27] Linking CXX shared library ../../../../build/intermediates/cxx/RelWithDebInfo/6ot2r1v6/obj/arm64-v8a/libreanimated.so
  FAILED: ../../../../build/intermediates/cxx/RelWithDebInfo/6ot2r1v6/obj/arm64-v8a/libreanimated.so 
  : && /Users/ahmetefeakyazi/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --sysroot=/Users/ahmetefeakyazi/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -frtti -stdlib=libc++ -DREACT_NATIVE_MINOR_VERSION=72 -DREANIMATED_VERSION=3.3.0 -DHERMES_ENABLE_DEBUGGER=0 -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all -std=c++17 -Wall -Werror -DJS_RUNTIME_HERMES=1 -O2 -g -DNDEBUG  -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Qunused-arguments -Wl,--no-undefined -shared -Wl,-soname,libreanimated.so -o ../../../../build/intermediates/cxx/RelWithDebInfo/6ot2r1v6/obj/arm64-v8a/libreanimated.so CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/FabricUtils.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/ReanimatedUIManagerBinding.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Fabric/ShadowTreeCloner.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModule.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedRuntime.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Registries/EventHandlerRegistry.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Registries/NewestShadowNodesRegistry.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/SharedItems/Shareables.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/FeaturesConfig.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/JsiUtils.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/ReanimatedVersion.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/RuntimeDecorator.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/Scheduler.cpp.o CMakeFiles/reanimated.dir/Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/Common/cpp/Tools/WorkletEventHandler.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/AndroidErrorHandler.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/AndroidLogger.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/AndroidScheduler.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/LayoutAnimations.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/NativeProxy.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/OnLoad.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/TurboModule.cpp.o  -llog  -landroid  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/folly_runtime/libs/android.arm64-v8a/libfolly_runtime.so  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/glog/libs/android.arm64-v8a/libglog.so  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/reactnativejni/libs/android.arm64-v8a/libreactnativejni.so  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/34c2120d0d3cd8dc97826fc02c9e8fc4/transformed/jetified-fbjni-0.3.0/prefab/modules/fbjni/libs/android.arm64-v8a/libfbjni.so  /Users/ahmetefeakyazi/.gradle/caches/transforms-3/e1925d27dfeda554a62fa91e748dc57a/transformed/jetified-hermes-android-0.72.1-release/prefab/modules/libhermes/libs/android.arm64-v8a/libhermes.so   -latomic -lm && :
  ld: error: undefined symbol: folly::dynamic::dynamic(folly::dynamic&&)
  >>> referenced by NativeArray.h:40 (/Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/reactnativejni/include/react/jni/NativeArray.h:40)
  >>>               CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o:(facebook::jni::basic_strong_ref<facebook::jni::HybridClass<facebook::react::ReadableNativeArray, facebook::react::NativeArray>::JavaPart, facebook::jni::LocalReferenceAllocator> facebook::jni::HybridClass<facebook::react::ReadableNativeArray, facebook::react::NativeArray>::newObjectCxxArgs<folly::dynamic>(folly::dynamic&&))
  >>> referenced by NativeMap.h:40 (/Users/ahmetefeakyazi/.gradle/caches/transforms-3/58a3e1b28d5beee274fc1f9b2978b700/transformed/jetified-react-android-0.72.1-release/prefab/modules/reactnativejni/include/react/jni/NativeMap.h:40)
  >>>               CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o:(facebook::jni::basic_strong_ref<facebook::jni::HybridClass<facebook::react::ReadableNativeMap, facebook::react::NativeMap>::JavaPart, facebook::jni::LocalReferenceAllocator> facebook::jni::HybridClass<facebook::react::ReadableNativeMap, facebook::react::NativeMap>::newObjectCxxArgs<folly::dynamic>(folly::dynamic&&))
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.
  
  C++ build system [build] failed while executing:
      /Users/ahmetefeakyazi/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/android/.cxx/RelWithDebInfo/6ot2r1v6/arm64-v8a \
        reanimated
    from /Users/ahmetefeakyazi/Desktop/Files/projects/react-native/todolist/node_modules/react-native-reanimated/android

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

See https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 9s
33 actionable tasks: 25 executed, 8 up-to-date```

This happened to me when I updated the emulators to the latest versions on Android Studio, no clue why.

I use M1 too

Thank you so much! It worked. But I wonder why, as I’ve read on another websites this version accomplishes the M1 support.