Hermes: JS error only in release
Error text
E/ReactNativeJS: TypeError: undefined is not an object (evaluating 'a.b.c') Hermes: Execution of bytecode failed in release build only
Cause
An app that works in debug breaks in release. Release minifies code, disables __DEV__ and runs Hermes bytecode.
Step-by-step fix
- Pull the real error text with
adb logcat. - Create a bundle with
--dev falseand reproduce the same error. - Check code that depends on debug-only things (
__DEV__, dev menu). - Update the suspect library; you need a Hermes-compatible version.
- Map the error line back to real code with the source map.
Example commands
adb logcat -s ReactNativeJS:V ReactNative:V npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output /tmp/i.bundle --sourcemap-output /tmp/i.map cd android && ./gradlew assembleRelease
How to prevent it
Test the release APK on a real phone every week, not just on the last day.
Author and license: Nibras Code
- APK will not install
- What is a parse error?
- The keystore is lost
- The signatures do not match
- Package name error
- The APK file is damaged
- Play Protect blocks the app
- The package appears to be invalid
- Not enough storage
- The phone is not compatible
- An older version will not install
- XAPK will not install
- Gradle sync failed
- Could not resolve a dependency
- Duplicate class error
- Manifest merger failed
- Dex limit: 65536 methods
- R8: Missing class
- JDK version mismatch
- SDK location not found
- minSdkVersion conflict
- compileSdk is too low
- EAS build: Gradle failure
- expo prebuild error
- Metro: Unable to resolve module
- White screen in release
- Red screen: cannot reach Metro
- Expo SDK mismatch
- Capacitor sync error
- Capacitor: white screen
- EAS: keystore and credentials error
- Keystore was tampered with / wrong password
- Wrong key alias or password
- Play: signed with the wrong key
- INSTALL_FAILED_UPDATE_INCOMPATIBLE
- INSTALL_FAILED_VERSION_DOWNGRADE
- INSTALL_FAILED_INSUFFICIENT_STORAGE
- INSTALL_FAILED_NO_MATCHING_ABIS
- Parse error (problem parsing the package)
- "App not installed" error
- Installing an AAB file on a phone
- adb: device "unauthorized"
- adb: device not found
- adb server version mismatch
- Activity class does not exist
- Play: targetSdk level too low
- Play: permissions policy rejection
- Play: 64-bit requirement
- Play: versionCode already used
- ClassNotFound / NoSuchMethod crash
- OutOfMemoryError crash
- CLEARTEXT communication not permitted
- SecurityException: permission denied