React-native-gesture-handler: _RNGestureHandlerModule.default.Direction in react native 0.60.0

Created on 6 Jul 2019  路  10Comments  路  Source: software-mansion/react-native-gesture-handler

I have used the following configurations.

    "react": "16.8.6",
    "react-native": "0.60.0",
    "react-native-gesture-handler": "^1.3.0",
    "react-navigation": "^3.11.0",
    "react-navigation-fluid-transitions": "^0.3.2"

In react-native latest version 0.60.0, facing an issue.

Most helpful comment

Looks like this is to do with the new autolinking feature in RN 0.60. To fix for now just add the following podspec for RNGesureHandler to ios/Podfile

pod 'RNGestureHandler', :podspec => '../node_modules/react-native-gesture-handler/RNGestureHandler.podspec'

Then in the ios directory run pod install to install it.

All 10 comments

I'm also seeing this same issue when building for iOS. I used the typescript template and the following:

yarn add react-navigation
yarn add react-native-gesture-handler
react-native link

I see the same error as described above.

My dependencies:

"dependencies": {
    "@types/axios": "^0.14.0",
    "axios": "^0.19.0",
    "react": "16.8.6",
    "react-native": "0.60.0",
    "react-native-elements": "^1.1.0",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-touchable-scale": "^2.0.0",
    "react-native-vector-icons": "^6.6.0",
    "react-navigation": "^3.11.0"
  },
  "devDependencies": {
    "@babel/core": "^7.4.5",
    "@babel/runtime": "^7.4.5",
    "@react-native-community/eslint-config": "^0.0.5",
    "@types/jest": "^24.0.15",
    "@types/react": "^16.8.23",
    "@types/react-native": "^0.57.65",
    "@types/react-test-renderer": "^16.8.2",
    "babel-jest": "^24.8.0",
    "eslint": "^6.0.1",
    "jest": "^24.8.0",
    "metro-react-native-babel-preset": "^0.54.1",
    "react-test-renderer": "16.8.6",
    "typescript": "^3.5.2"
  },

After build I catch two errors

Unhandled JS Exception: null is not an object (evaluating '_RNGestureHandlerModule.default.Direction')

RCTFatal
-[RCTExceptionsManager reportFatalException:stack:exceptionId:]
__invoking___
-[NSInvocation invoke]
-[NSInvocation invokeWithTarget:]
-[RCTModuleMethod invokeWithBridge:module:arguments:]
facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&)
facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const
invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_lane_serial_drain
_dispatch_lane_invoke
_dispatch_workloop_worker_thread
_pthread_wqthread
start_wqthread

And

Module AppRegistry is not a registered callable module (calling runApplication)

callFunctionReturnFlushedQueue
    [native code]:0

Sometimes build does not throw any errors, but after first click I getting this one

Module RCTEventEmitter is not a registered callable module (calling receiveTouches)

__callFunction
    index.bundle?platform=ios&dev=true&minify=false:2227:18
<unknown>
    index.bundle?platform=ios&dev=true&minify=false:1971:31
__guard
    index.bundle?platform=ios&dev=true&minify=false:2183:15
callFunctionReturnFlushedQueue
    index.bundle?platform=ios&dev=true&minify=false:1970:21
callFunctionReturnFlushedQueue
    [native code]:0

Dependencies

    "react": "16.8.6",
    "react-native": "0.60.0",
    "react-native-gesture-handler": "^1.3.0",
    "react-navigation": "^3.11.0"

Looks like this is to do with the new autolinking feature in RN 0.60. To fix for now just add the following podspec for RNGesureHandler to ios/Podfile

pod 'RNGestureHandler', :podspec => '../node_modules/react-native-gesture-handler/RNGestureHandler.podspec'

Then in the ios directory run pod install to install it.

@hellotoby
Thanks, it works for me.

@hellotoby

After about 2 hours of trying to figure this out, this worked. Insane that this seems to be a huge problem for everyone.

HI @hellotoby i followed your fix but still i'm still having same error

TypeError: null is not an object (evaluating '_RNGestureHandlerModule.default.Direction')
ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

My depedencies

"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/toolbar-android": "0.1.0-rc.2",
"@react-native-firebase/app": "^8.2.0",
"@react-native-firebase/auth": "^8.2.0",
"@react-navigation/native": "^5.7.2",
"@react-navigation/stack": "^5.8.0",
"react": "16.13.1",
"react-native": "0.63.1",
"react-native-gesture-handler": "^1.7.0",
"react-native-reanimated": "^1.10.1",
"react-native-safe-area-context": "^3.1.1",
"react-native-screens": "^2.9.0"

i followed the installation here https://reactnative.dev/docs/navigation

Can you please help me ?

Hello same problem here

"@react-native-community/masked-view": "^0.1.10",
"react": "^16.13.1",
"react-native": "^0.63.2",
"react-native-calendar-events": "^1.6.4",
"react-native-check-version": "^1.0.4",
"react-native-datepicker": "^1.7.2",
"react-native-device-info": "^5.5.4",
"react-native-fbsdk": "^1.1.2",
"react-native-firebase": "^5.4.0",
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "^1.7.0",
"react-native-router-flux": "4.2.0",

But only on Android build

Duplicate of #494.

Finally solved the problem for android
-react-native link react-native-gesture-handler
-react-native link react-native-safe-area-context
-build from android

  • npx react-native run-android
    Enjoy!!!!

THX man it's work like charm @Sayyamabbasi786

Was this page helpful?
0 / 5 - 0 ratings