react-native: `Invariant Violation: Native module cannot be null` error info does not show the precise stack of which module is null

i got this error: Invariant Violation: Native module cannot be null, and i want to know which native module is null so i can come to handle it, but the error stack message dose not show any useful message for me to investigate it

Invariant Violation: Native module cannot be null.
reportException @ ExceptionsManager.js:44
handleException @ ExceptionsManager.js:113
handleError @ setUpErrorHandling.js:23
reportFatalError @ error-guard.js:49
guardedLoadModule @ require.js:204
metroRequire @ require.js:128
(anonymous) @ deprecatedTypes.ts:40
executeApplicationScript @ RNDebuggerWorker.js:2
(anonymous) @ RNDebuggerWorker.js:2

React Native version:

System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 1.99 GB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.3.1 - /usr/local/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.13.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 21, 23, 26, 27, 28
      Build Tools: 23.0.1, 26.0.1, 28.0.3, 29.0.2
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5900203
    Xcode: 11.2/11B52 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.4 => 0.61.4

Steps To Reproduce

[skip reproduce step]

Describe what you expected to happen:

the error log of Invariant Violation: Native module cannot be null. show the exact stack message of the null module

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 16
  • Comments: 31

Most upvoted comments

Facing the same problem too IMG_0902 😦 Does anyone got solution for this?

I am facing the same issue after adding react-native-dialogflow to my app, I have reinstalled it, but still facing the same error. I really don;t understand how so many people are facing this issue and noone is able to resolve it for them.

截屏2020-06-11 13 02 01 facing the problem too

I have the same exact issue as all of you. image

i

For expo users, “expo upgrade” should do the job

I had to remove dialogflow, and systematically install different versions of DFlow until i got the latest version of Dflow that was compatible with the version of react-native (using Expo) i am using.

ill have to dig up the exact commands I used. If the above doesnt help i can spend some time to find out exactly what I did.

Hey. I have the same error now.

Package.json

{
  "name": "MyApp",
  "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": {
    "@react-native-community/async-storage": "^1.9.0",
    "@react-native-community/datetimepicker": "^2.3.2",
    "@react-native-community/masked-view": "^0.1.9",
    "@react-native-community/netinfo": "^5.7.1",
    "@react-navigation/bottom-tabs": "^5.2.7",
    "@react-navigation/compat": "^5.1.10",
    "@react-navigation/drawer": "^5.5.0",
    "@react-navigation/native": "^5.1.6",
    "@react-navigation/stack": "^5.2.11",
    "axios": "^0.19.2",
    "core-js": "^3.6.5",
    "data.task": "^3.1.2",
    "moment": "^2.24.0",
    "react": "^16.11.0",
    "react-native": "0.62.2",
    "react-native-actionsheet": "^2.4.2",
    "react-native-audio": "^4.3.0",
    "react-native-background-upload": "^5.6.1",
    "react-native-cached-image": "^1.4.3",
    "react-native-elements": "^1.2.7",
    "react-native-fetch-blob": "^0.10.8",
    "react-native-firebase": "^5.6.0",
    "react-native-fs": "^2.16.6",
    "react-native-gesture-handler": "^1.6.1",
    "react-native-get-random-values": "^1.4.0",
    "react-native-google-cast": "^3.3.0",
    "react-native-google-places": "^3.1.2",
    "react-native-image-crop-picker": "^0.28.0",
    "react-native-image-picker": "^2.3.1",
    "react-native-image-view": "^2.1.9",
    "react-native-indicators": "^0.17.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-loading-spinner-overlay": "^1.1.0",
    "react-native-modal-datetime-picker": "^8.5.4",
    "react-native-permissions": "^2.1.2",
    "react-native-push-notification": "^3.1.9",
    "react-native-reanimated": "^1.8.0",
    "react-native-safe-area-context": "^0.7.3",
    "react-native-screens": "^2.5.0",
    "react-native-snap-carousel": "^3.9.0",
    "react-native-sound": "^0.11.0",
    "react-native-thumbnail": "^1.1.3",
    "react-native-vector-icons": "^6.6.0",
    "react-native-video": "^4.4.5",
    "react-native-video-helper": "^1.4.4",
    "react-native-webview": "^9.0.1",
    "react-navigation": "^4.3.7",
    "react-redux": "^7.2.0",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0",
    "sendbird": "^3.0.121",
    "socket.io-client": "^2.3.0",
    "tipsi-stripe": "^7.5.3"
  },
  "devDependencies": {
    "@babel/core": "^7.6.2",
    "@babel/runtime": "^7.6.2",
    "@react-native-community/eslint-config": "^0.0.5",
    "babel-jest": "^24.9.0",
    "eslint": "^6.5.1",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.58.0",
    "react-test-renderer": "16.11.0"
  },
  "jest": {
    "preset": "react-native"
  },
  "rnpm": {
    "assets": [
      "./src/assets/fonts"
    ]
  }
}

Simulator Screen Shot - iPhone 11 - 2020-05-07 at 21 11 39 Simulator Screen Shot - iPhone 11 - 2020-05-07 at 21 11 42