facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.48k stars 24.26k forks source link

cannot read property handleSetJSResponder of null error in react native v0.70.3 #35143

Closed praveenreddy9 closed 1 month ago

praveenreddy9 commented 1 year ago

Description

Hello, I have updgraded my React Native version to 0.70.3 from 0.64.2 and accordingly upgraded the packages.

When running the debugging(react-native run-ios) for IOS, the above error is occurring on react-native-gesture-handler. If you have any method to fix this or any advice please share with me.

Added all the details(code,screenshots,errors) to check in-detailed,Thanks in advance.

Please help me in reolving the issue by sharing the sample code or steps for resolving.

Simulator Screen Shot - iPhone 14 Pro Max - 2022-10-25 at 15 36 24

**ERROR [react-native-gesture-handler] react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..).

For installation instructions, please refer to https://docs.swmansion.com/react-native-gesture-handler/docs/#installation**

Below are the list of packages used in the project,

{
  "name": "projectSetup",
  "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-async-storage/async-storage": "^1.17.10",
    "@react-native-community/cli": "^9.2.1",
    "@react-native-community/datetimepicker": "^6.5.2",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^9.3.5",
    "@react-native-masked-view/masked-view": "^0.2.8",
    "axios": "^1.1.3",
    "lodash": "^4.17.21",
    "react": "18.1.0",
    "react-native": "^0.70.3",
    "react-native-android-location-enabler": "^1.2.2",
    "react-native-calendars": "^1.1275.0",
    "react-native-camera": "^4.2.1",
    "react-native-device-info": "^10.2.1",
    "react-native-elements": "^3.4.2",
    "react-native-fast-image": "^8.6.1",
    "react-native-flexbox-grid": "^0.3.2",
    "react-native-geocoding": "^0.5.0",
    "react-native-geolocation-service": "^5.3.1",
    "react-native-gesture-handler": "^2.7.1",
    "react-native-image-crop-picker": "^0.38.0",
    "react-native-image-pan-zoom": "^2.1.12",
    "react-native-image-picker": "^4.10.0",
    "react-native-maps": "^1.3.2",
    "react-native-month-selector": "^1.4.0",
    "react-native-onesignal": "^4.4.1",
    "react-native-paper": "^4.12.5",
    "react-native-qrcode-scanner": "^1.5.5",
    "react-native-reanimated": "^2.11.0",
    "react-native-safe-area-context": "^3.4.1",
    "react-native-screens": "^3.18.2",
    "react-native-signature-capture": "^0.4.12",
    "react-native-sound": "^0.11.2",
    "react-native-sound-player": "^0.13.2",
    "react-native-svg": "^13.4.0",
    "react-native-vector-icons": "^9.2.0",
    "react-native-view-pdf": "^0.14.0",
    "react-native-webview": "^11.23.1",
    "react-navigation": "^4.4.4",
    "react-navigation-stack": "^2.10.4",
    "react-redux": "^7.1.1",
    "redux": "^4.2.0",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.4.1",
    "rn-fetch-blob": "^0.12.0",
    "socket.io-client": "^4.5.3"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.32.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "0.72.3",
    "react-test-renderer": "18.1.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

Version

0.70.3

Output of npx react-native info

info Fetching system and libraries information...
System:
    OS: macOS 13.0
    CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
    Memory: 37.48 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.10.0 - /usr/local/bin/node
    Yarn: 1.22.19 - ~/node_modules/.bin/yarn
    npm: 8.19.2 - /usr/local/bin/npm
    Watchman: 2022.10.03.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9014738
    Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: ^9.2.1 => 9.2.1 
    react: 18.1.0 => 18.1.0 
    react-native: ^0.70.3 => 0.70.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

For react native v0.70.3 project setup, after installing the "react-native-gesture-handler": "^2.7.1" getting the error at onPress

Snack, code example, screenshot, or link to a repository

Simulator Screen Shot - iPhone 14 Pro Max - 2022-10-25 at 15 36 24

Screenshot 2022-10-25 at 2 47 05 PM

Simulator Screen Shot - iPhone 14 Pro Max - 2022-10-25 at 14 40 59

dentemm commented 1 year ago

@praveenreddy9 It looks like you need to rebuild the iOS app

hend-elsahli commented 1 year ago

What worked for me:

vladis-c commented 1 year ago

For me it happens on Android...

abnerluan7 commented 1 year ago

other solution?

epshtielsl commented 1 year ago

npx pod-install yarn start --reset-cache clean project in Xcode

demithehomie commented 1 year ago

Im my case the error only happens in production, through the Play Console (Android)

Exception Process: com.domain.clubedomago, PID: 20191 com.facebook.react.common.JavascriptException: TypeError: Cannot read property 'handleSetJSResponder' of null, js engine: hermes, stack: anonymous@1:1286536 onChange@1:340694 changeResponder@1:284662 extractEvents@1:339138 anonymous@1:287602 batchedUpdatesImpl@1:345583 batchedUpdates@1:287252 _receiveRootNodeIDEvent@1:287525 receiveTouches@1:340511 callFunction@1:80278 anonymous@1:78789 guard@1:79726 callFunctionReturnFlushedQueue@1:78747 at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:72) at java.lang.reflect.Method.invoke at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372) at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:188) at com.facebook.jni.NativeRunnable.run at android.os.Handler.handleCallback (Handler.java:942) at android.os.Handler.dispatchMessage (Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27) at android.os.Looper.loopOnce (Looper.java:201) at android.os.Looper.loop (Looper.java:288) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:228) at java.lang.Thread.run (Thread.java:1012)

github-actions[bot] commented 1 year ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
norberton86 commented 1 year ago

Im my case the error only happens in production, through the Play Console (Android)

Exception Process: com.domain.clubedomago, PID: 20191 com.facebook.react.common.JavascriptException: TypeError: Cannot read property 'handleSetJSResponder' of null, js engine: hermes, stack: anonymous@1:1286536 onChange@1:340694 changeResponder@1:284662 extractEvents@1:339138 anonymous@1:287602 batchedUpdatesImpl@1:345583 batchedUpdates@1:287252 _receiveRootNodeIDEvent@1:287525 receiveTouches@1:340511 callFunction@1:80278 anonymous@1:78789 guard@1:79726 callFunctionReturnFlushedQueue@1:78747 at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:72) at java.lang.reflect.Method.invoke at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372) at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:188) at com.facebook.jni.NativeRunnable.run at android.os.Handler.handleCallback (Handler.java:942) at android.os.Handler.dispatchMessage (Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27) at android.os.Looper.loopOnce (Looper.java:201) at android.os.Looper.loop (Looper.java:288) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:228) at java.lang.Thread.run (Thread.java:1012)

HI did you finally found the solution for this bug?

jasim00021 commented 1 year ago

same for me on ios

jasim00021 commented 1 year ago

solution make sure install "react-native-gesture-handler": "~2.12.0",

after install you need to wrap your root componet which is App.js


`// import "react-native-gesture-handler";

import { GestureHandlerRootView } from "react-native-gesture-handler";

LogBox.ignoreAllLogs();

//-------------------------------------//
export default function App() {

  return (
    <GestureHandlerRootView style={{ flex: 1 }}>

          <NavigationContainer>
            <SafeAreaView style={Styles.container}>
            <HomeNavigation /> 

          </NavigationContainer>

    </GestureHandlerRootView>
  );
}
`

for more information visit react-native-gesture-handle doc

MobinAkhter commented 7 months ago

Im my case the error only happens in production, through the Play Console (Android)

Exception Process: com.domain.clubedomago, PID: 20191 com.facebook.react.common.JavascriptException: TypeError: Cannot read property 'handleSetJSResponder' of null, js engine: hermes, stack: anonymous@1:1286536 onChange@1:340694 changeResponder@1:284662 extractEvents@1:339138 anonymous@1:287602 batchedUpdatesImpl@1:345583 batchedUpdates@1:287252 _receiveRootNodeIDEvent@1:287525 receiveTouches@1:340511 callFunction@1:80278 anonymous@1:78789 guard@1:79726 callFunctionReturnFlushedQueue@1:78747 at com.facebook.react.modules.core.ExceptionsManagerModule.reportException (ExceptionsManagerModule.java:72) at java.lang.reflect.Method.invoke at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372) at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:188) at com.facebook.jni.NativeRunnable.run at android.os.Handler.handleCallback (Handler.java:942) at android.os.Handler.dispatchMessage (Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27) at android.os.Looper.loopOnce (Looper.java:201) at android.os.Looper.loop (Looper.java:288) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:228) at java.lang.Thread.run (Thread.java:1012)

Did you fix it? Exact same bug for me

react-native-bot commented 1 month ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

react-native-bot commented 1 month ago

This issue was closed because it has been stalled for 7 days with no activity.