ARTICLE AD BOX
I am trying to build an apk for my react native project (Bare CLI).
Node version: v24.13.1
React-native: "0.84.0"
I am following two ways:
1. Just running the following commands:
cd android/
./gradlew clean
./gradlew assembleRelease
2. Doing following steps:
keytool -genkeypair -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
I provide all the details
Place the my-release-key.keystore file under the android/app directory.
Edit the android/gradle.properties file and add the following (replace ***** with the actual keystore password, alias, and key password):
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore MYAPP_RELEASE_KEY_ALIAS=my-key-alias MYAPP_RELEASE_STORE_PASSWORD=***** MYAPP_RELEASE_KEY_PASSWORD=***** Modify the android/app/build.gradle file to add the signing config: android { ... defaultConfig { ... } signingConfigs { release { if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) { storeFile file(MYAPP_RELEASE_STORE_FILE) storePassword MYAPP_RELEASE_STORE_PASSWORD keyAlias MYAPP_RELEASE_KEY_ALIAS keyPassword MYAPP_RELEASE_KEY_PASSWORD } } } buildTypes { release { ... signingConfig signingConfigs.release } } }Generating the APK:
cd android ./gradlew assembleRelease
But then I get the following build error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:createBundleReleaseJsAndAssets'.
\> Couldn't determine Hermesc location. Please set react.hermesCommand to the path of the hermesc binary file. node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc
The problem is inside node_modules/react-native -> sdks folder does not exist, this path is not valid
And so i go on to create one myself:
yarn add hermes-engine --dev
This creates a folder inside node_modules:
hermes-engine where win_64-> hermes.exe exist and so i give that path instead in app/build.gradle:
Note that by defualt it was commented and was:
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"and so what then happened was that build was successful and apk got created and I install it in my mobile(android) but it crashes(app keeps stopping) each time i try to open the app.
I have tried contacting friends who are react native developers and found none manually added the path in hermesCommand.
What am I doing wrong here?
