Using RN 0.62.1 (built from source) and hermes-engine 0.4.2-rc1 builds are failing on windows running the hermes binary at react-native/react.gradle line 165.
The only output is:
FAILURE: Build failed with an exception.
* Where:
Script 'C:\projects\MyProject\node_modules\react-native\react.gradle' line: 165
* What went wrong:
Execution failed for task ':app:bundleDebugJsAndAssets'.
> Process 'command 'cmd'' finished with non-zero exit value -1073741515
Running gradle with verbose output gives no additional info. The only way I can get around this is to disable hermes. I'm stumped about where to go with this since it's giving me no info. Thoughts?
I suppose the error is referring to the command at https://github.com/facebook/react-native/blob/master/react.gradle#L176.
I'm not familiar with gradle. But I suppose you could ask gradle to print out the full command, and run it manually to see if you get any more details.
I was thinking the same thing, but unfortunately I'm not familiar with gradle either, I'm not sure how to make it print out the command.
I've had to disable hermes for now since I was unable to figure out any additional information about the problem. The only clue I have is that the build works fine on my machine but fails on my teammate's machine with the same codebase and SDK versions.... It seems maybe this is some sort of windows quirk?
the same issue here when hermes is enabled
Same issue.
The failing command looks like this:
cmd /c hermes -emit-binary -out C:\path\to\project\android\app\build\generated\assets\react\release\index.android.bundle.hbc C:\path\to\project\android\app\build\generated\assets\react\release\index.android.bundle -O
It looks like Hermes binaries for Windows stopped working at all since the upgrade to 0.62.
I tried calling hermes executable directly. The Linux binary works, but the Windows binary exits immediately without producing any output.
Any workarounds?
@SimpleCreations I just downloaded hermes-engine npm v0.5.0 and v0.4.1 and tried running the hermes executable from each on Windows. Both worked fine. So, the binaries are definitely working.
How exactly are you invoking the binary when you are seeing it fail? Which version? Can you try it with a simple file like this:
Z:\tmp>type hello.js
print("hello");
Z:\tmp>hermes.exe --emit-binary --out hello.hbc hello.js
Z:\tmp>dir hello.*
Volume in drive Z is Shared Folders
Volume Serial Number is 0000-0064
Directory of Z:\tmp
06/01/2020 05:54 PM 16 hello.js
06/01/2020 06:03 PM 276 hello.hbc
2 File(s) 292 bytes
0 Dir(s) 482,156,675,072 bytes free
Z:\tmp>hermes.exe hello.hbc
hello
@tmikov thank you for your reply. I figured it out.
Apparently I was missing Visual C++ runtime. When I posted my first comment, I used PowerShell to run hermes. Now I have tried cmd, which actually showed a dialog saying VC runtime was missing.
I didn't assume I have to install anything since previous version of hermes worked just fine.
In case anyone else has the same error, here's the link to Visual C++:
https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads
@SimpleCreations the runtime is packaged with Hermes in the NPM, but we may have missed something. Which file specifically was missing?
@tmikov had to download and install the runtime from Microsoft website - I've left a link in my previous reply; the file was vc_redist.x64.exe under "Visual Studio 2015, 2017 and 2019".
@SimpleCreations as I mentioned, the VC redistributable files are already packaged inside the hermes-engine npm: msvcp140.dll and vcruntime140.dll . You should not need to install the VC runtime separately.
However, it is possible that we missed a file. Do you remember which dll specifically was the error box referring to?
@tmikov I believe it was vcruntime140_1.dll
I was just trying to get hermes working on Windows today and I found this issue (good @SimpleCreations mentioned dll few minutes ago :) ).
It seems like VCRUNTIME140_1.dll is the problematic one, it's missing on my side as well and hermes.exe is throwing this error:

Hermes works with the same project/files if I run it on Windows's Ubuntu OS.
Thank you! We will update the NPMs ASAP.
In case it may be related, I've noticed that in cygwin and mingw terminal I get another error message:
hermes.exe: error while loading shared libraries: icuin64.dll: cannot open shared object file: No such file or directory
I just fixed this issue by downloading vc_redist.x64.exe for 64 bit machine or vc_redist.x86.exe for 32 bit machine from
https://support.microsoft.com/en-in/help/2977003/the-latest-supported-visual-c-downloads
under Visual Studio 2015, 2017 and 2019
Nice one @JacksonGL. That seem to solve it for me as well, I don't get any error when starting hermes.exe this time (in any of terminals mentioned above).
Maybe docs should be updated with this finding? https://reactnative.dev/docs/hermes#note-for-windows-users
@tmikov @AndrewMorsillo @SimpleCreations @JogiPrasadPakki @tad3j Guys, could you please show your exact version of redist?
I've installed vc_redist.x64.exe and I had 2015 version, but If I try to run hermesc.exe I've got error about VCRUNTIME140_1.dll
I've solved this problem. I've installed Visual Studio 2019 community version.
FYI: VCRUNTIME140_1.dll file should locate in Windows/System32 folder and you can download and paste manually this file into this folder or you should install Visual Studio 2019.
[email protected] has been released and includes this missing DLL, so hopefully this won't be a problem anymore!
Most helpful comment
I just fixed this issue by downloading vc_redist.x64.exe for 64 bit machine or vc_redist.x86.exe for 32 bit machine from
https://support.microsoft.com/en-in/help/2977003/the-latest-supported-visual-c-downloads
under Visual Studio 2015, 2017 and 2019