Cannot build an app when using Reanimated and V8
See original GitHub issueDescription
When I try to use reanimated 2 with react-native-v8, gradle sync in Android Studio fails with the following error:
Starting Gradle Daemon...
Gradle Daemon started in 1 s 373 ms
> Task :react-native-gradle-plugin:compileKotlin UP-TO-DATE
> Task :react-native-gradle-plugin:compileJava NO-SOURCE
> Task :react-native-gradle-plugin:pluginDescriptors UP-TO-DATE
> Task :react-native-gradle-plugin:processResources UP-TO-DATE
> Task :react-native-gradle-plugin:classes UP-TO-DATE
> Task :react-native-gradle-plugin:inspectClassesForKotlinIC UP-TO-DATE
> Task :react-native-gradle-plugin:jar UP-TO-DATE
> Configure project :react-native-reanimated
Native libs debug enabled: false
Android gradle plugin: 7.2.1
Gradle: 7.5.1
building Reanimated2
> Task :prepareKotlinBuildScriptModel UP-TO-DATE
C/C++: debug|x86 :CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
C/C++: debug|x86 :Please set them or make sure they are set and tested correctly in the CMake files:
C/C++: debug|x86 :V8EXECUTOR_LIB
C/C++: debug|x86 : linked by target "reanimated" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-reanimated/android
C/C++: debug|x86 :CMake Generate step failed. Build files cannot be regenerated correctly.
[CXX1405] error when building with cmake using /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-reanimated/android/CMakeLists.txt: Build command failed.
Error while executing process /Users/lukasz.kinasiewicz/Library/Android/sdk/cmake/3.18.1/bin/cmake with arguments {-H/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-reanimated/android -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=21 -DANDROID_PLATFORM=android-21 -DANDROID_ABI=x86 -DCMAKE_ANDROID_ARCH_ABI=x86 -DANDROID_NDK=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_ANDROID_NDK=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=/Users/lukasz.kinasiewicz/Library/Android/sdk/cmake/3.18.1/bin/ninja -DCMAKE_CXX_FLAGS=-fstack-protector-all -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-reanimated/android/build/intermediates/cxx/Debug/591x5v3h/obj/x86 -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-reanimated/android/build/intermediates/cxx/Debug/591x5v3h/obj/x86 -DCMAKE_BUILD_TYPE=Debug -B/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-reanimated/android/.cxx/Debug/591x5v3h/x86 -GNinja -DANDROID_STL=c++_shared -DNATIVE_DEBUG=false -DREACT_NATIVE_TARGET_VERSION=70 -DANDROID_TOOLCHAIN=clang -DBOOST_VERSION=1_76_0 -DNODE_MODULES_DIR=/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules -DJS_RUNTIME=v8 -DJS_RUNTIME_DIR=/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8 -DCLIENT_SIDE_BUILD=true -DIS_NEW_ARCHITECTURE_ENABLED=false -DPLAYGROUND_APP_NAME=reanimatedApp -DRNVERSION=70}
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
V8EXECUTOR_LIB
linked by target "reanimated" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-reanimated/android
CMake Generate step failed. Build files cannot be regenerated correctly.
C/C++: debug|x86 :CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
C/C++: debug|x86 :Please set them or make sure they are set and tested correctly in the CMake files:
C/C++: debug|x86 :FBJNI_LIB
C/C++: debug|x86 : linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
C/C++: debug|x86 :FOLLY_LIB
C/C++: debug|x86 : linked by target "reactnative_internal_static" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
C/C++: debug|x86 : linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
C/C++: debug|x86 :GLOG_LIB
C/C++: debug|x86 : linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
C/C++: debug|x86 :JSINSPECTOR_LIB
C/C++: debug|x86 : linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
C/C++: debug|x86 :JSI_LIB
C/C++: debug|x86 : linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
C/C++: debug|x86 :REACT_NATIVE_JNI_LIB
C/C++: debug|x86 : linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
C/C++: debug|x86 :V8_ANDROID_LIB
C/C++: debug|x86 : linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
C/C++: debug|x86 :CMake Generate step failed. Build files cannot be regenerated correctly.
[CXX1405] error when building with cmake using /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android/CMakeLists.txt: Build command failed.
Error while executing process /Users/lukasz.kinasiewicz/Library/Android/sdk/cmake/3.18.1/bin/cmake with arguments {-H/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=21 -DANDROID_PLATFORM=android-21 -DANDROID_ABI=x86 -DCMAKE_ANDROID_ARCH_ABI=x86 -DANDROID_NDK=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_ANDROID_NDK=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=/Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=/Users/lukasz.kinasiewicz/Library/Android/sdk/cmake/3.18.1/bin/ninja -DCMAKE_CXX_FLAGS=-fstack-protector-all -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android/build/intermediates/cxx/Debug/195v332w/obj/x86 -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android/build/intermediates/cxx/Debug/195v332w/obj/x86 -DCMAKE_BUILD_TYPE=Debug -B/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android/.cxx/Debug/195v332w/x86 -GNinja -DANDROID_STL=c++_shared -DBOOST_VERSION=1_76_0 -DBUILD_DIR=/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android/build -DRN_DIR=/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native -DREACT_NATIVE_TARGET_VERSION=70 -DV8_ANDROID_DIR=/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/v8-android-jit -DSO_DIR=/Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android/build/jniLibs}
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/lukasz.kinasiewicz/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FBJNI_LIB
linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
FOLLY_LIB
linked by target "reactnative_internal_static" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
GLOG_LIB
linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
JSINSPECTOR_LIB
linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
JSI_LIB
linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
REACT_NATIVE_JNI_LIB
linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
V8_ANDROID_LIB
linked by target "v8executor" in directory /Users/lukasz.kinasiewicz/dev/reanimatedApp/node_modules/react-native-v8/android
CMake Generate step failed. Build files cannot be regenerated correctly.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.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/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 28s
5 actionable tasks: 5 up-to-date
Steps to reproduce
- Clone the linked repo
yarnyarn start- Open
androiddirectory in Android Studio - In Android Studio run
Sync project with gradle files- it logs the error mentioned above - In Android Studio run
Run app- the application throws an exception due to missinglibv8android.so.
Notes:
- If I run
yarn androidthe app builds and works properly. - Android Studio version is 2021.2.1 Patch 1
Snack or a link to a repository
https://github.com/lkinasiewicz/reanimatedApp
Reanimated version
2.10.0
React Native version
0.70.0
Platforms
Android
JavaScript runtime
V8
Workflow
No response
Architecture
No response
Build type
No response
Device
No response
Device model
No response
Acknowledgements
Yes
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Debugging worklets | React Native Reanimated - Open Source
These are the debugging tools we checked for compatibility with React Native apps using the Reanimated library: Chrome debugger (also known as the...
Read more >Using Hermes Engine - Expo Documentation
One of the many limitations of remote debugging is that it does not work with modules built on top of JSI. For example,...
Read more >task :react-native-reanimated:downloadboost failed - You.com
I cannot build my app for Android (iOS works perfectly) in a yarn monorepo project. When I run yarn run android , I...
Read more >Does anyone use flipper mainly to debug? : r/reactnative
Yeah my app's interactions are built around reanimated, so I can't even „just disable it“ to debug. It sucks.
Read more >react-native-reanimated - npm
Start using react-native-reanimated in your project by running `npm i ... TypeScript icon, indicating that this package has built-in type ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thought I’d drop some data to help everyone out. We use both
react-native-reanimated@2.10.0andreact-native-v8@1.4.7successfully in our project. We have never received any of the errors mentioned.Here are our versions:
In app/build.gradle make sure you have:
Thank you to the authors of both of these plugins. Since the official support landed last month both reanimated and v8 have been working together flawlessly for us at Shipt.
I got the same issue as well. For now I just downgraded to 2.9.1, but looking for a solution for 2.10