react-native: App Crash when debug is enabled on android

Hi, I’m using react native 0.64, sdk version 29, I can run my app with npx react-native run-android but if I enable the debug the app start to crash with the error

react native no source url loaded have you initialize the instance?

on metro bundler I got this error

Error: Unable to resolve module ./debugger-ui/debuggerWorker.aca173c4.js from C:\Users\Marco\git\myapp/.:

My platform is Windows 10 with a Xiaomi Redmi phone, but I tested both with the android emulator and MacOS and the problem is always the same

I googled and I seems an error that was known on expo, but I’m not using expo, this is my configuration:

package.json

{
  "name": "youcoach2",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@eva-design/eva": "^2.1.0",
    "@fortawesome/fontawesome-free": "^5.15.3",
    "@fortawesome/fontawesome-pro": "^5.15.3",
    "@fortawesome/fontawesome-svg-core": "^1.2.35",
    "@fortawesome/free-brands-svg-icons": "^5.15.3",
    "@fortawesome/free-regular-svg-icons": "^5.15.3",
    "@fortawesome/free-solid-svg-icons": "^5.15.3",
    "@fortawesome/pro-light-svg-icons": "^5.15.3",
    "@fortawesome/pro-regular-svg-icons": "^5.15.3",
    "@fortawesome/pro-solid-svg-icons": "^5.15.3",
    "@fortawesome/react-native-fontawesome": "^0.2.6",
    "@react-native-community/async-storage": "^1.12.1",
    "@react-native-community/blur": "^3.6.0",
    "@react-native-community/datetimepicker": "^3.4.6",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/native": "^5.9.4",
    "@ui-kitten/components": "^5.0.0",
    "add": "^2.0.6",
    "axios": "^0.21.1",
    "immutable": "^4.0.0-rc.12",
    "react": "17.0.1",
    "react-native": "0.64.0",
    "react-native-calendars": "^1.1255.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-image-crop-picker": "^0.36.0",
    "react-native-keychain": "^7.0.0",
    "react-native-push-notification": "^7.2.3",
    "react-native-reanimated": "^2.1.0",
    "react-native-responsive-dimensions": "^3.1.1",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-screens": "^3.1.1",
    "react-native-svg": "^12.1.1",
    "react-native-webview": "^11.4.0",
    "react-navigation": "^4.4.4",
    "react-navigation-backhandler": "^2.0.1",
    "react-navigation-drawer": "^2.7.0",
    "react-redux": "^7.2.3",
    "redux": "^4.0.5",
    "redux-persist": "^6.0.0",
    "xdate": "^0.8.2",
    "yarn": "^1.22.10"
  },
  "devDependencies": {
    "@babel/core": "^7.13.15",
    "@babel/runtime": "^7.13.10",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.24.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.65.2",
    "react-test-renderer": "17.0.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

build.gradle

buildscript {
    ext {
        googlePlayServicesVersion = "+" // default: "+"
        firebaseMessagingVersion = "+" // default: "+"
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 29
        ndkVersion = "20.1.5948944"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.1.0")
        classpath('com.google.gms:google-services:4.3.3')
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        maven { url 'https://www.jitpack.io' }
    }
}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 18
  • Comments: 17 (2 by maintainers)

Most upvoted comments

@Bayramito I have installed “react-native-reanimated”: “^2.3.0-alpha.2” and react-native:“0.66.0” but if I enable the debug the app start to crash with the error

`Error: Unable to resolve module ./debugger-ui/ui.e31bb0bc.js from /.:

None of these files exist:

  • debugger-ui/ui.e31bb0bc.js(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
  • debugger-ui/ui.e31bb0bc.js/index(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx) at ModuleResolver.resolveDependency (/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:107:15) at DependencyGraph.resolveDependency (/node_modules/metro/src/node-haste/DependencyGraph.js:288:43) at /node_modules/metro/src/lib/transformHelpers.js:129:24 at Server._resolveRelativePath (/node_modules/metro/src/Server.js:1072:12) at async Server.requestProcessor [as _processSourceMapRequest] (/node_modules/metro/src/Server.js:428:37) at async Server._processRequest (/node_modules/metro/src/Server.js:389:7) Error: Unable to resolve module ./debugger-ui/ui.e31bb0bc.css from /.: `

Have you found any fix on this? im having the similar issue now

@sathishk2030 @bombillazo As per rn-reanimated’s installation docs at https://docs.swmansion.com/react-native-reanimated/docs/2.2.0/installation#installing-the-package: “Please note that Reanimated 2 doesn’t support remote debugging, only Flipper can be used for debugging.”, so give Flipper a go 😃

Upgrading react-native-reanimated to 2.4.1 fixed the issue for me.

I have react-native-reanimated 2.4.1, but I’m having the similar issue now

on “react-native-reanimated”: “^2.3.0-alpha.2” debug with chrome should be fixed please check release notes. https://github.com/software-mansion/react-native-reanimated/releases

any work around or temporary fix, without removing react-native-reanimated ?