Android Build Issue with New Architecture
See original GitHub issueDescription
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-reanimated:configureCMakeRelWithDebInfo[arm64-v8a]'.
> [CXX1405] error when building with cmake using /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android/CMakeLists.txt: Build command failed.
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
482 actionable tasks: 477 executed, 5 up-to-date
Error while executing process /usr/local/lib/android/sdk/cmake/3.18.1/bin/cmake with arguments {-H/home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/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=arm64-v8a -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DANDROID_NDK=/usr/local/lib/android/sdk/ndk/21.4.7075529 -DCMAKE_ANDROID_NDK=/usr/local/lib/android/sdk/ndk/21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=/usr/local/lib/android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=/usr/local/lib/android/sdk/cmake/3.18.1/bin/ninja -DCMAKE_CXX_FLAGS=-fstack-protector-all -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android/build/intermediates/cxx/RelWithDebInfo/w47432nr/obj/arm64-v8a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android/build/intermediates/cxx/RelWithDebInfo/w47432nr/obj/arm64-v8a -DCMAKE_BUILD_TYPE=RelWithDebInfo -B/home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android/.cxx/RelWithDebInfo/w47432nr/arm64-v8a -GNinja -DANDROID_STL=c++_shared -DNATIVE_DEBUG=false -DREACT_NATIVE_TARGET_VERSION=70 -DANDROID_TOOLCHAIN=clang -DBOOST_VERSION=1_76_0 -DNODE_MODULES_DIR=/home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules -DJS_RUNTIME=hermes -DJS_RUNTIME_DIR=/home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native/sdks/hermes -DCLIENT_SIDE_BUILD=true -DIS_NEW_ARCHITECTURE_ENABLED=true -DPLAYGROUND_APP_NAME=Trademanza-ReactNative -DRNVERSION=70}
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-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: /usr/local/lib/android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-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:
FABRICJNI
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
FBJNI_LIB
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
FOLLY_LIB
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
GLOG_LIB
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
JSI_LIB
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
REACT_DEBUG
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
REACT_NATIVE_JNI_LIB
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
REACT_RENDER_COMPONENTREGISTRY
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
REACT_RENDER_CORE
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
REACT_RENDER_DEBUG
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
REACT_RENDER_MOUNTING
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
REACT_RENDER_SCHEDULER
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
REACT_RENDER_UIMANAGER
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
RRC_ROOT
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
RRC_VIEW
linked by target "reanimated" in directory /home/runner/work/Trademanza-ReactNative/Trademanza-ReactNative/node_modules/react-native-reanimated/android
CMake Generate step failed. Build files cannot be regenerated correctly.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)
* 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/
BUILD FAILED in 5m 46s
Steps to reproduce
- Install cmake using
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "cmake;3.18.1" - Generate APK using
./gradlew assembleRelease
Snack or a link to a repository
https://github.com/software-mansion/react-native-reanimated
Reanimated version
3.0.0-rc.2
React Native version
0.70.1
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Release mode
Device
No response
Device model
No response
Acknowledgements
Yes
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:21 (11 by maintainers)
Top Results From Across the Web
Support 64-bit architectures - Android Developers
Go to Build Settings and ensure you are building for Android by verifying that the Unity symbol is next to Android under Platform....
Read more >React Native Android Build with new architecture enabled ...
I have a react native project with newArchitecure enabled (i.e new NativeModule system (TurboModule) and the new Renderer (Fabric)).
Read more >Bundled Hermes - React Native
Android Users on New Architecture ... Due to the nature of our native code build setup (i.e. how we use the NDK), users...
Read more >applicationVariants.all {...} in app/build.gradle throws error ...
Then I enabled new architecture by following RN doc. However npx react-native run-android throws error about an existing ...
Read more >Building for Android - Unity - Manual
Select File > Build Settings. · From the list of platforms in the Platform pane, select Android. · Enable Build App Bundle (Google...
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

@tomekzaw while 2.11 fixes the issue on Android with the new arch, it does break iOS new arch. This happens on RN 0.69 as well as RN 0.70. Here are my logs:
I can confirm that Reanimated 2.11.0 (plus patch referenced in https://github.com/software-mansion/react-native-reanimated/issues/3571#issue-1374122743) does compile with the new architecture on RN 0.69.4 and V8 (so building from source)