react-native-macos/packages
JoseLion 7fcdb9d9d8 fix(android): Append `.exe` to hermesc binary path for Windows users (#34151)
Summary:
Resolves https://github.com/facebook/react-native/issues/34116.

In a nutshell, the problem was a missing `.exe` extension on the `hermesc` binary path when running on Windows OS. The missing extension causes the method `.exists()` of the File instance to always return false, so none of the conditions ever met and an error was thrown whenever a release build with Hermes enabled was run on Windows. More details can be found in the comments on the above issues.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Fix error of release builds with Hermes enabled for Windows users

Pull Request resolved: https://github.com/facebook/react-native/pull/34151

Test Plan:
### Reproduce

Changes on Gradle scrips are better tested on an actual application. To reproduce the issue you can:
1. Create or reuse a React Native application with version `v0.69.1` on a Windows machine
2. Enable Hermes on Android following the steps on the [documentation](https://reactnative.dev/docs/hermes#enabling-hermes)
3. Clean the build folder: `cd android && ./gradlew clean`
4. Bundle the JS and assets for a release version: `./gradlew bundleReleaseJsAndAssets`
5. The build fails with the following error:
```shell
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> java.lang.Exception: Couldn't determine Hermesc location. Please set `project.ext.react.hermesCommand` to the path of the hermesc binary file. node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc
```

### Test the changes

Follow the same steps above using the fix on this PR and the error should disappear 🙂

Reviewed By: NickGerleman

Differential Revision: D37755468

Pulled By: cortinico

fbshipit-source-id: 2ad0ced583555b907259df116f64a45da6d153f3
2022-08-04 08:33:16 -07:00
..
assets Remove redundant js_library_glob calls 2022-07-12 05:20:36 -07:00
babel-plugin-codegen Fix babel-plugin-codegen crash when export init is null (#33387) 2022-03-11 23:24:22 -08:00
eslint-config-react-native-community Bump eslint-config-react-native-community (#34307) 2022-08-01 04:28:08 -07:00
eslint-plugin-react-native-community fix(eslint-config): switch to new babel parser (#34020) 2022-06-21 21:04:42 -07:00
eslint-plugin-specs Add postpack hook that undoes prepack 2022-07-29 03:56:23 -07:00
normalize-color Remove redundant js_library_glob calls 2022-07-12 05:20:36 -07:00
polyfills Suppress missing 'this' annotations in xplat/js 2022-07-07 21:53:53 -07:00
react-native-codegen Ensure equivalent Flow and TypeScript turbo module definition generates the same output (#34251) 2022-07-27 08:36:02 -07:00
react-native-gradle-plugin fix(android): Append `.exe` to hermesc binary path for Windows users (#34151) 2022-08-04 08:33:16 -07:00
rn-tester Add missing class annotations and lock xplat/js 2022-08-03 17:45:53 -07:00