React Native Android crashes on enabling debug mode

All we need is an easy explanation of the problem, so here it is.

Shaking the android device and hit Debug, and it crashes every time right away. From the Android Studio logcat, it shows No source URL loaded, have you initialised the instance?:

java.lang.AssertionError: No source URL loaded, have you initialised the instance?
    at com.facebook.infer.annotation.Assertions.assertNotNull(
    at com.facebook.react.modules.debug.SourceCodeModule.getTypedExportedConstants(
    at com.facebook.fbreact.specs.NativeSourceCodeSpec.getConstants(
    at com.facebook.react.bridge.JavaModuleWrapper.getConstants(
    at Method)
    at android.os.Handler.handleCallback(
    at android.os.Handler.dispatchMessage(
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(
    at android.os.Looper.loop(
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$

The same react native codebase, turning on dubug mode on ios is working fine, but on Android it always crash when debug mode is turned on. I can’t see what’s causing it by the error log.

Here are the dependencies I have for the react native app, and I’m using redux and redux-devtools-extension for debugging. Am I missing any libraries?

"dependencies": {
  "@react-native-async-storage/async-storage": "^1.15.14",
  "@reduxjs/toolkit": "^1.7.0",
  "expo": "~42.0.1",
  "expo-permissions": "12.1.0",
  "expo-splash-screen": "~0.11.2",
  "expo-status-bar": "~1.0.4",
  "expo-updates": "~0.8.1",
  "react": "17.0.2",
  "react-dom": "17.0.2",
  "react-native": "0.64.1",
  "react-native-fast-image": "^8.5.11",
  "react-native-gesture-handler": "~1.10.2",
  "react-native-navigation": "^7.14.0",
  "react-native-reanimated": "~2.1.0",
  "react-native-screens": "3.2.0",
  "react-native-unimodules": "~0.13.3",
  "react-native-web": "0.16.3",
  "react-redux": "^7.2.6",
  "redux-persist": "^6.0.0",
  "tslint": "^6.1.3",
  "tslint-react": "^5.0.0"
"devDependencies": {
  "@babel/core": "^7.9.0",
  "@types/react": "17.0.5",
  "@types/react-native": "0.64.5",
  "babel-preset-expo": "~8.3.0",
  "jest-expo": "~41.0.0",
  "redux-devtools-extension": "^2.13.9",
  "typescript": "4.2.4"

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

After some more search arounds, found this is a known issue in react-native-reanimated. As their website points out

Please note that Reanimated 2 doesn’t support remote debugging, only
Flipper can be used for debugging.

Another github issue also pointed out this issue

This is expected, you can’t use remote debugging with turbomodules
(which Reanimated v2 is using). Check out Flipper to debug your app.

Removing this library fixed the issue.

  1. Remove the react-native-reanimated dependency in package.json
  2. Remove related code in android’s
  3. yarn install or npm install
  4. Go to the ios folder and run pod install
  5. Go the the android folder and run ./gradlew clean
  6. Rebuild the app. yarn android and yarn ios

Another alternative is to use Flipper for debugging instead.

Method 2

Upgrading react-native-reanimated to 2.4.1 may fix this issue.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply