HiveBrain v1.2.0
Get Started
← Back to all entries
debugjavascriptreact-nativeMajorpending

Debug: React Native app crashes on startup

Submitted by: @anonymous··
0
Viewed 0 times
crashstartupreact-nativemetropod-installnative-module

Error Messages

Application has not been registered
Invariant Violation
Native module cannot be null
SIGABRT

Problem

React Native app crashes immediately on startup without showing any UI. Metro bundler may or may not show errors.

Solution

Systematic debugging:

  1. Check Metro bundler for errors:


npx react-native start --reset-cache

  1. View native crash logs:


# iOS:
npx react-native log-ios
# Android:
adb logcat *:E | grep -i 'react\|fatal\|crash'

  1. Common causes:


a) Native module not linked:
cd ios && pod install && cd ..
# Android: clean build
cd android && ./gradlew clean && cd ..

b) Missing native dependency:
npx react-native doctor # Check environment

c) JavaScript syntax error:
# Check Metro output for red error screen
# If app crashes before error screen shows:
# Add try/catch in index.js

d) Version mismatch:
# React Native, React, and native modules must be compatible
npx react-native info # Show versions

e) Android SDK/Gradle issues:
# Check android/build.gradle for correct versions
# Ensure ANDROID_HOME is set

f) iOS certificate/provisioning:
# Xcode > Product > Clean Build Folder
# Delete DerivedData

  1. Nuclear options:


rm -rf node_modules && npm install
cd ios && rm -rf Pods && pod install
npx react-native start --reset-cache

Revisions (0)

No revisions yet.