Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing Issue with new Architecture using (Microsoft Visual Studio 2022, CMake) Task :ReactAndroid:hermes-engine:buildHermes FAILED FAILURE: Build failed with an exception. #34175

Closed
gunjantaazaa opened this issue Jul 12, 2022 · 7 comments
Labels
Platform: Android Android applications. Platform: Windows Building on Windows. Tech: Hermes Hermes Engine: https://hermesengine.dev/ Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@gunjantaazaa
Copy link

gunjantaazaa commented Jul 12, 2022

Description

Getting this issue while running android build.
I have already check with gradle clean but failed.

Using Windows 10 built-in ICU
Warning: NMake does not support parallel builds. Ignoring parallel build command line option.
NMAKE : fatal error U1077: 'C:\PROGRA1\MIB0551\2022\COMMUN1\VC\Tools\MSVC\14321.313\bin\Hostx86\x86\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':ReactAndroid:hermes-engine:buildHermes'.

Process 'command 'cmd'' finished with non-zero exit value 2

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

Version

0.69.1

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: Windows 10 10.0.22000
CPU: (16) x64 AMD Ryzen 7 5700U with Radeon Graphics
Memory: 734.17 MB / 7.34 GB
Binaries:
Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Version 2021.1.0.0 AI-211.7628.21.2111.8309675
Visual Studio: 17.2.32616.157 (Visual Studio Community 2022)
Languages:
Java: 11.0.12
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.1 => 0.69.1
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

Environment configured with Java 11 and node 16.13.0
Install cmake with Set path on System Variable.
Install Visual Studio 2022
Open terminal in Visual Studio 2022.
Run command npx react-native run-android

Snack, code example, screenshot, or link to a repository

I have also enableHermes but still not works

@gunjantaazaa gunjantaazaa added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Jul 12, 2022
@gunjantaazaa gunjantaazaa changed the title Get on Issue with new Architecture using (Microsoft Visual Studio 2022, CMake) Task :ReactAndroid:hermes-engine:buildHermes FAILED FAILURE: Build failed with an exception. Facing Issue with new Architecture using (Microsoft Visual Studio 2022, CMake) Task :ReactAndroid:hermes-engine:buildHermes FAILED FAILURE: Build failed with an exception. Jul 12, 2022
@react-native-bot react-native-bot added the Platform: Android Android applications. label Jul 12, 2022
@rafaelfrancisco-dev
Copy link

Facing same issue here

@gunjantaazaa
Copy link
Author

gunjantaazaa commented Jul 14, 2022

project.ext.react = [
enableHermes: true, // clean and rebuild if changing
hermesCommand: '../../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc'
]

You have to add hermesc path.
This should fix the issue for Windows 10 and above

#34116 Thanks @jose Luis Leon

@cortinico
Copy link
Contributor

NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX86\x86\nmake.exe"' : return code '0x2'

I'm not entirely sure why you're seeing this error code. According to this article it seems like your Visual Studio installation is not complete and needs to be re-installed. Can you try to do so.

@cortinico cortinico added Tech: Hermes Hermes Engine: https://hermesengine.dev/ and removed Needs: Triage 🔍 labels Jul 29, 2022
@HussainArif12
Copy link

HussainArif12 commented Sep 13, 2022

Facing the same issue here as well. Here's what I tried to do to fix it:

  • Reinstall Android SDK and NDK
  • Reinstall Visual Studio and build tools
  • Create a blank project and then enable Fabric.
    However, I still failed to resolve the issue.
    Platform: Windows 10
    React Native version: 0.70

@kelset kelset added the Platform: Windows Building on Windows. label Sep 13, 2022
@fr-an-k
Copy link

fr-an-k commented Nov 14, 2022

I have the same issue with a fresh Build Tools install, CL version 19.34.31933 for x86

@ronickg
Copy link

ronickg commented Dec 31, 2022

Same issue here as well. Cant get react native 0.70.5 to run on windows

@cortinico
Copy link
Contributor

Task :ReactAndroid:hermes-engine:buildHermes FAILED FAILURE: Build failed with an exception

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android Android applications. Platform: Windows Building on Windows. Tech: Hermes Hermes Engine: https://hermesengine.dev/ Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

8 participants