react-native: [Windows] Task :ReactAndroid:hermes-engine:buildCMakeRelease[arm64-v8a][libhermes] FAILED
Description
Hi i tried to build my react native project but am getting the following error
> Task :ReactAndroid:downloadBoost
Download https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz
> Task :ReactAndroid:downloadBoost UP-TO-DATE
> Task :ReactAndroid:downloadDoubleConversion UP-TO-DATE
Download https://github.com/google/double-conversion/archive/v1.1.6.tar.gz
> Task :ReactAndroid:downloadFmt UP-TO-DATE
Download https://github.com/fmtlib/fmt/archive/6.2.1.tar.gz
> Task :ReactAndroid:downloadFolly UP-TO-DATE
Download https://github.com/facebook/folly/archive/v2021.06.28.00.tar.gz
> Task :ReactAndroid:downloadGlog UP-TO-DATE
Download https://github.com/google/glog/archive/v0.3.5.tar.gz
> Task :ReactAndroid:downloadLibevent UP-TO-DATE
Download https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
> Task :ReactAndroid:hermes-engine:downloadHermes UP-TO-DATE
Download https://github.com/facebook/hermes/tarball/hermes-2022-05-20-RNv0.69.0-ee8941b8874132b8f83e4486b63ed5c19fc3f111
> Task :ReactAndroid:hermes-engine:configureBuildForHermes
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
-- Found the following ICU libraries:
-- uc (required)
-- i18n (required)
-- data (required)
-- uc (required)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR ICU_LIBRARY) (Required is at least version "52")
-- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- CMAKE_HOST_SYSTEM_NAME = Windows
-- CMAKE_SYSTEM_NAME = Windows
-- HERMES_APPLE_TARGET_PLATFORM =
-- CMAKE_CROSSCOMPILING = FALSE
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/alade/Desktop/Cliqueon/node_modules/react-native/ReactAndroid/hermes-engine/build/hermes
> Task :ReactAndroid:hermes-engine:buildHermes
Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
LLVHDemangle.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\external\llvh\lib\Demangle\Debug\LLVHDemangle.lib
dtoa.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\external\dtoa\Debug\dtoa.lib
LLVHSupport.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\external\llvh\lib\Support\Debug\LLVHSupport.lib
zip.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\external\zip\Debug\zip.lib
hermesOptimizer.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\Debug\hermesOptimizer.lib
hermesFrontEndDefs.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\FrontEndDefs\Debug\hermesFrontEndDefs.lib
hermesPlatformUnicode.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\Platform\Unicode\Debug\hermesPlatformUnicode.lib
hermesRegex.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\Regex\Debug\hermesRegex.lib
hermesSupport.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\Support\Debug\hermesSupport.lib
hermesADT.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\ADT\Debug\hermesADT.lib
hermesFlowParser.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\FlowParser\Debug\hermesFlowParser.lib
hermesAST.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\AST\Debug\hermesAST.lib
hermesParser.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\Parser\Debug\hermesParser.lib
hermesAST2JS.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\AST2JS\Debug\hermesAST2JS.lib
hermesSourceMap.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\SourceMap\Debug\hermesSourceMap.lib
hermesInst.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\Inst\Debug\hermesInst.lib
hermesFrontend.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\Debug\hermesFrontend.lib
hermesBackend.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\BCGen\Debug\hermesBackend.lib
hermesHBCBackend.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\BCGen\HBC\Debug\hermesHBCBackend.lib
hermesCompilerDriver.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\lib\CompilerDriver\Debug\hermesCompilerDriver.lib
hermesc.vcxproj -> C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\bin\Debug\hermesc.exe
> Task :ReactAndroid:hermes-engine:buildCMakeRelease[arm64-v8a][libhermes]
C/C++: ninja: error: 'C:/Users/alade/Desktop/Cliqueon/node_modules/react-native/ReactAndroid/hermes-engine/build/hermes/bin/Release/hermesc.exe', needed by 'lib/InternalBytecode/InternalBytecode.hbc', missing and no known rule to make it
> Task :ReactAndroid:hermes-engine:buildCMakeRelease[arm64-v8a][libhermes] 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.3.3/userguide/command_line_interface.html#sec:command_line_warnings
34 actionable tasks: 8 executed, 26 up-to-date
CMake Deprecation Warning at CMakeLists.txt:42 (cmake_policy):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Using Windows 10 built-in ICU
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ReactAndroid:hermes-engine:buildCMakeRelease[arm64-v8a][libhermes]'.
> Build command failed.
Error while executing process C:\Users\alade\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe with arguments {-C C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\.cxx\Release\1c2w6o2l\arm64-v8a libhermes}
ninja: Entering directory `C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\.cxx\Release\1c2w6o2l\arm64-v8a'
ninja: error: 'C:/Users/alade/Desktop/Cliqueon/node_modules/react-native/ReactAndroid/hermes-engine/build/hermes/bin/Release/hermesc.exe', needed by 'lib/InternalBytecode/InternalBytecode.hbc', 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
BUILD FAILED in 3m 54s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
CMake Deprecation Warning at CMakeLists.txt:42 (cmake_policy):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Using Windows 10 built-in ICU
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ReactAndroid:hermes-engine:buildCMakeRelease[arm64-v8a][libhermes]'.
> Build command failed.
Error while executing process C:\Users\alade\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe with arguments {-C C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\.cxx\Release\1c2w6o2l\arm64-v8a libhermes}
ninja: Entering directory `C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine\.cxx\Release\1c2w6o2l\arm64-v8a'
ninja: error: 'C:/Users/alade/Desktop/Cliqueon/node_modules/react-native/ReactAndroid/hermes-engine/build/hermes/bin/Release/hermesc.exe', needed by 'lib/InternalBytecode/InternalBytecode.hbc', 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
BUILD FAILED in 3m 54s
at makeError (C:\Users\alade\Desktop\Cliqueon\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\alade\Desktop\Cliqueon\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\alade\Desktop\Cliqueon\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\alade\Desktop\Cliqueon\node_modules\@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
C:\Users\alade\Desktop\Cliqueon>yarn android
Version
0.69.0
Output of npx react-native info
Execution failed for task ‘:ReactAndroid:hermes-engine:buildCMakeRelease[arm64-v8a][libhermes]’.
Build command failed. Error while executing process C:\Users\alade\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe with arguments {-C C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine.cxx\Release\1c2w6o2l\arm64-v8a libhermes} ninja: Entering directory `C:\Users\alade\Desktop\Cliqueon\node_modules\react-native\ReactAndroid\hermes-engine.cxx\Release\1c2w6o2l\arm64-v8a’
ninja: error: ‘C:/Users/alade/Desktop/Cliqueon/node_modules/react-native/ReactAndroid/hermes-engine/build/hermes/bin/Release/hermesc.exe’, needed by ‘lib/InternalBytecode/InternalBytecode.hbc’, missing and no known rule to make it
Steps to reproduce
react native init project yarn android os architecture: windows 10 5gb ram processor: intel dual core 64bit processor os: windows 10
Snack, code example, screenshot, or link to a repository
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 90 (17 by maintainers)
@MuhammadRafeh This problem is because your system won’t have ICU, i got the same problem using Ubuntu 22.04 and solved by installing from the source.
long path
enabled on my system.android\build.gradle
file to version23.2.8568313
worked :@mganandraj thank you again .
Same happening for me when updating my project to react native 0.69.1 with the new architecture enabled.
Yes, it happens in a new project only after new architecture is enabled.
From: Nicola Corti @.> Sent: Thursday, June 30, 2022 10:51:23 AM To: facebook/react-native @.> Cc: Stephen Collins @.>; Mention @.> Subject: Re: [facebook/react-native] Task :ReactAndroid:hermes-engine:buildCMakeRelease[arm64-v8a][libhermes] FAILED (Issue #34084)
Thansk for the report @nibblesnbitshttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnibblesnbits&data=05|01||387ec99b87594a8320c008da5aa800b7|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637921974854590259|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=h7RlGhGJ4h539uXmUmbGSDjPrFVZUslpz2GPVkw9sP8%3D&reserved=0 I will look into this. To help me understand:
— Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffacebook%2Freact-native%2Fissues%2F34084%23issuecomment-1171319719&data=05|01||387ec99b87594a8320c008da5aa800b7|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637921974854590259|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=r36qxRZjwqmh1GqEczdBz%2FkFWlLv8ASpr1PsD2PIFtI%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABODKJN6TN66N3V22TXBNNLVRWX6XANCNFSM5Z7TUX4A&data=05|01||387ec99b87594a8320c008da5aa800b7|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637921974854590259|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=CLDLZcrKpJDSTKG0tAihbz5wNl9i0k8UB1yOfD1aFPk%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>
Any updates to this issue? it is especially annoying when trying to build it in the cloud with
expo eas
Is the only workaround to install the ICU libs locally?
For running it locally just run
sudo apt-get install libicu-dev
(Ubuntu 22.04
) then it works locally.@cortinico Getting this issue on a Mac M1 machine, with a fresh new architecture project. None of the solutions mentioned here works. Any pointers would be appreciated.
Sadly no progress with this building under windows.Finally I was able to make this work in Windows.
I wen’t ahead and created a WSL2 instance with ubuntu and I can build the same project fine. (It’s a clean project)
But in the windows machine the build fails due to the maximum full path to an object file.
Here’s the log output.
First during the compile phase there’s a warning about the AndroidProgressbarMeasurementsManager.cpp:
Then, later on the build process I get this error:
I’ve added back in the app/build.gradle some of the code from 0.68.1 to test… but I had no success.
Adding the following fixed it for me:
In the project level build.gradle
Line 1
Line 19 or after the first System.properties check (depending on your config)
I hope this helps you guys find some path to solve your issues. Full repo with changes can be checked here
Same issue with me
I’ve created a couple of PRs : https://github.com/facebook/react-native/pull/34790 https://github.com/facebook/react-native/pull/34791
@therafi Could you please try these?
Nothing has changed 🤷 Still get the missing rule error with Version 0.70.1
Yes, I was able to make it work in both Windows and WSL. But I was using react native 0.69.1 never tried 0.70
Edit: Full bundleRelease build log: https://pastebin.com/aRCaBs8c
yarn android --active-arch-only build log: https://pastebin.com/FDTV54sq
Both on windows 11
Same; two errors. for debug build (
npx react-native run-android
):with
gradlew.bat bundleRelease
:It seems the debug build is trying to depend on a release build of hermes, but an attempt at a release build assumes one already exists. 🤷
EDIT: Might be worth noting that
node_modules\react-native\ReactAndroid\hermes-engine\build\hermes\bin\Debug\hermesc.exe
DOES exists afternpx react-native run-android
, but the error message indicates that for some reason it’s looking fornode_modules/react-native/ReactAndroid/hermes-engine/build/hermes/bin/Release/hermesc.exe
, not the debug one.We saw the same issue and couldn’t solve it by following the linked instructions. The hermesc.exe in Debug Folder exists, Release Folder is empty leading to this error. We tried it on different Windows 10 Systems.
It happens also if you ran the task directly from Visual Studio Developer Command Prompot:
gradlew.bat :ReactAndroid:hermes-engine:assembleRelease
gradlew.bat :ReactAndroid:hermes-engine:assembleDebug
fails too, because it tries to link against a release hermesc.exe which obviously doesn’t exist.I have the same issue in 0.71.14
This issue is fixed in React Native 0.71 (as this task won’t be executing anymore). Please migrate to 0.71 and try again. If the issue persists, open a new issue. Thank you
@mganandraj I’m using
"react-native": "0.70.1"
in a newly created project..\gradlew assembleRelease
inside theDeveloper Command Prompt for VS 2022
to share the full log and for some reason I was getting a different error now same as hereWindows already can handle long file names but it requires the apps to opt into it by prefixing the file paths with a special sequence and by avoiding certain old APIs. Android ndk21 still uses the old binutils distribution whose ‘ar’ utility still can’t support long file paths. We will be in much better shape once we upgrade to ndk23.
@rayhk6 not yet , it could be a bug I guess so I just disabled the new arch for the moment
Thansk for the report @nibblesnbits I will look into this. To help me understand:
I am having same problem 0.71.14
@alabsi91 not working above solution…
@alabsi91 The log snippet says the static library creation is failing which points to the limitation of the “ar” tool in ndk 21 to handle the file paths more than 260 chars long. This restriction might go away once we switch to ndk 23 or higher. By the way, Did you enable long file path support in windows ? https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
@cortinico Great to hear about the plans to simplify the Hermes builds. Lmk if you need any help in coding or testing …
The PRs fixed hermes and character scape errors for me. great work.
But later I got the character scape error for react-native-gesture-handler:
Android-rncli.cmake
file:I did workaround this error using the react-native.config.js at my project root:
Then later got a different error for react-native-reanimated, which fixed by updating to
3.0.0-rc.3
.And finally managed to get a successful build. 🎉 Ran on emulator with no errors.
This was a debug build usign
yarn android
, But when building release usinggradlew assembleRelease
I got this error:I was encountering the same issue as https://github.com/facebook/react-native/issues/34084#issuecomment-1253767539 with the same setup, which is the same as https://github.com/facebook/react-native/issues/34084#issuecomment-1255355730
I managed to reach this step either by compiling the hermes project manually as release in VS2022 or by copying the debug exe to the release folder. This is the first issue that required a workaround.
I also installed the ICU libraries, because it kept saying that
data
was missing, but I’m not sure if that had any impact on the solution, because the output still saysFailed to find all ICU components (missing: ICU_INCLUDE_DIR) (Required is at least version "52")
.The second issue was a syntax issue, in this block in
node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
For some reason, add_library is not liking mixed directory separators, and is interpreting the backslash from the windows style directory separator as an escape character. By manually typing the path as above, I managed to bypass the problem.
The following CMAKE_PATH path transformation looks like it would resolve the issue, but it requires a newer version of CMake than the required one in the file, 3.24 instead of 3.13. https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#path-transformations
The proper fix for windows would be to not mix slashes and backslashes when generating the file list.
same on MAC OS with RN 0.69.4
` FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
I got same problem but if fixed that wit install libicu-dev my os is mint 20.3 ubuntu base 20.04
sudo apt -y libicu-dev
and the problem is solved
Good day folks @JoseLion said he was able to reproduce the error and fix the issue check out the link below to see how he did it https://github.com/facebook/react-native/issues/34116. special thanks to @JoseLion, @wfern and @cortinico for their time and effort to help reproduce and fix this issue.
Yes we are
when i set the hermesCommand variable and run bundleRelease i get the following error :ReactAndroid:hermes-engine:buildCMakeMinSizeRel[arm64-v8a][libhermes] FAILED C/C++: ninja: error: ‘C:/Users/alade/Desktop/Cliqueon/node_modules/react-native/ReactAndroid/hermes-engine/build/hermes/bin/MinSizeRel/hermesc.exe’, needed by ‘lib/InternalBytecode/InternalBytecode.hbc’, missing and no known rule to make it
FAILURE: Build failed with an exception.
ninja: error: ‘C:/Users/alade/Desktop/Cliqueon/node_modules/react-native/ReactAndroid/hermes-engine/build/hermes/bin/MinSizeRel/hermesc.exe’, needed by ‘lib/InternalBytecode/InternalBytecode.hbc’, missing and no known rule to make it
i also noticed the error below: LLVM_HOST_TRIPLE can’t be computed on Windows with this toolchain