Case No. 002 · Closed
Red Screen of Death on React Native
The app ran perfectly on the simulator. On real devices, it crashed on launch.
The Incident
The app passed every check on the simulator. Then it landed on real Android devices and collapsed on launch, leaving only a red screen and an unhelpful error. Testers described the scene as "very red."
The Investigation
After a long stakeout through native logs, the culprit turned out to be a mismatched native dependency left behind by a recent upgrade. The JavaScript side was innocent. The trouble was hiding in the native build cache all along. Exhibit A below shows the suspect in action.
Exhibit A: the suspect
{
"dependencies": {
"react-native": "^0.73.0",
"react-native-reanimated": "^3.6.0"
}
}
The Verdict
A clean rebuild, a pinned dependency version, and a note in the README. The app now launches on every device, and the red screen has been retired. Exhibit B shows the fix.
Exhibit B: the fix
# Pin the exact versions, then rebuild from scratch
npm install --save-exact react-native-reanimated@3.6.1
cd android && ./gradlew clean && cd ..
npx react-native start --reset-cache
npx react-native run-android